play/make-graphics.ps1 (1873 bytes)
1 # Draws the store graphics: the 512 px icon and the 1024x500 feature graphic. 2 # Usage: powershell -File play/make-graphics.ps1 -Out fastlane/metadata/android/en-US/images 3 param([string]$Out) 4 Add-Type -AssemblyName System.Drawing 5 6 $blue = [System.Drawing.Color]::FromArgb(255, 0, 0x55, 0x77) 7 8 # The ribbon of the launcher icon (M40,30 L68,30 L68,80 L54,69 L40,80 Z), 9 # with its centre at (cx, cy) and h pixels high. 10 function Ribbon($g, $cx, $cy, $h) { 11 $s = $h / 50 12 $pts = @(@(-14, -25), @(14, -25), @(14, 25), @(0, 14), @(-14, 25)) | ForEach-Object { 13 New-Object System.Drawing.PointF ([single]($cx + $_[0] * $s)), ([single]($cy + $_[1] * $s)) 14 } 15 $g.FillPolygon([System.Drawing.Brushes]::White, [System.Drawing.PointF[]]$pts) 16 } 17 18 function Canvas($w, $h) { 19 $bmp = New-Object System.Drawing.Bitmap $w, $h 20 $g = [System.Drawing.Graphics]::FromImage($bmp) 21 $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias 22 $g.TextRenderingHint = [System.Drawing.Text.TextRenderingHint]::AntiAliasGridFit 23 $g.Clear($blue) 24 return $bmp, $g 25 } 26 27 # Icon: Google Play rounds the corners itself, so the square is full. 28 $bmp, $g = Canvas 512 512 29 Ribbon $g 256 256 300 30 $bmp.Save((Join-Path $Out "icon.png"), [System.Drawing.Imaging.ImageFormat]::Png) 31 $g.Dispose(); $bmp.Dispose() 32 33 # Feature graphic. 34 $bmp, $g = Canvas 1024 500 35 Ribbon $g 190 250 250 36 $big = New-Object System.Drawing.Font "Segoe UI Semibold", 96 37 $small = New-Object System.Drawing.Font "Segoe UI", 34 38 $g.DrawString("sbm", $big, [System.Drawing.Brushes]::White, 330, 110) 39 $g.DrawString("Your bookmarks, the same", $small, [System.Drawing.Brushes]::White, 340, 270) 40 $g.DrawString("on each of your devices", $small, [System.Drawing.Brushes]::White, 340, 320) 41 $bmp.Save((Join-Path $Out "featureGraphic.png"), [System.Drawing.Imaging.ImageFormat]::Png) 42 $g.Dispose(); $bmp.Dispose()