$ErrorActionPreference = 'Stop' Add-Type -AssemblyName System.Drawing $dir = 'D:\腾讯\吕布\吕布视频资产\t1338场景板' $items = @( @('T1_雪原古道_风雪.png', 'T1 雪原古道·风雪'), @('T2_关前校场_晨光.png', 'T2 关前校场·晨光'), @('T3_烽火战场_黄昏.png', 'T3 烽火战场·黄昏'), @('T4_暮色河岸_大江.png', 'T4 暮色河岸·大江') ) $cellW = 840; $cellH = 473; $pad = 12; $labelH = 30 $bmp = New-Object System.Drawing.Bitmap ((2 * $cellW + 3 * $pad), (2 * ($cellH + $labelH) + 3 * $pad)) $g = [System.Drawing.Graphics]::FromImage($bmp) $g.Clear([System.Drawing.Color]::FromArgb(16,16,16)) $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic $font = New-Object System.Drawing.Font('Microsoft YaHei', 13, [System.Drawing.FontStyle]::Bold) for ($i = 0; $i -lt $items.Count; $i++) { $img = [System.Drawing.Image]::FromFile((Join-Path $dir $items[$i][0])) $x = $pad + ($i % 2) * ($cellW + $pad) $y = $pad + [math]::Floor($i / 2) * ($cellH + $labelH + $pad) $g.DrawImage($img, $x, $y, $cellW, $cellH) $img.Dispose() $g.DrawString($items[$i][1], $font, [System.Drawing.Brushes]::White, $x, ($y + $cellH + 3)) } $out = Join-Path $dir 't1338系列_场景板_四宫格.png' $bmp.Save($out, [System.Drawing.Imaging.ImageFormat]::Png) $g.Dispose(); $bmp.Dispose() Write-Host "saved $out"