mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-29 22:02:10 +00:00
ci: add MSIX logo asset generator and generated assets
This commit is contained in:
BIN
scripts/msix/assets/Square150x150Logo.png
Normal file
BIN
scripts/msix/assets/Square150x150Logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
scripts/msix/assets/Square44x44Logo.png
Normal file
BIN
scripts/msix/assets/Square44x44Logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
scripts/msix/assets/StoreLogo.png
Normal file
BIN
scripts/msix/assets/StoreLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
31
scripts/msix/generate_assets.ps1
Normal file
31
scripts/msix/generate_assets.ps1
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Generates the MSIX package logo assets from the 192px master logo.
|
||||||
|
# Run once on Windows (re-run if the logo changes), then commit the PNGs in assets/.
|
||||||
|
# Scale-200 variants would need a >192px master; regenerate from OrcaSlicer.svg if ever needed.
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
Add-Type -AssemblyName System.Drawing
|
||||||
|
|
||||||
|
$repoRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
||||||
|
$source = Join-Path $repoRoot 'resources\images\OrcaSlicer_192px.png'
|
||||||
|
$outDir = Join-Path $PSScriptRoot 'assets'
|
||||||
|
New-Item -ItemType Directory -Force $outDir | Out-Null
|
||||||
|
|
||||||
|
$sizes = @{
|
||||||
|
'Square150x150Logo.png' = 150
|
||||||
|
'Square44x44Logo.png' = 44
|
||||||
|
'Square44x44Logo.targetsize-44_altform-unplated.png' = 44
|
||||||
|
'StoreLogo.png' = 50
|
||||||
|
}
|
||||||
|
|
||||||
|
$src = [System.Drawing.Image]::FromFile($source)
|
||||||
|
foreach ($name in $sizes.Keys) {
|
||||||
|
$px = $sizes[$name]
|
||||||
|
$bmp = New-Object System.Drawing.Bitmap($px, $px)
|
||||||
|
$gfx = [System.Drawing.Graphics]::FromImage($bmp)
|
||||||
|
$gfx.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
|
||||||
|
$gfx.DrawImage($src, 0, 0, $px, $px)
|
||||||
|
$gfx.Dispose()
|
||||||
|
$bmp.Save((Join-Path $outDir $name), [System.Drawing.Imaging.ImageFormat]::Png)
|
||||||
|
$bmp.Dispose()
|
||||||
|
Write-Output "Wrote $name (${px}x${px})"
|
||||||
|
}
|
||||||
|
$src.Dispose()
|
||||||
Reference in New Issue
Block a user