| 1234567891011121314151617181920212223242526272829 |
- # Source for the white outline bell PNG. Kept as PNG for native WeChat Image support.
- Add-Type -AssemblyName System.Drawing
- $assetPath = Join-Path $PSScriptRoot '../src/assets/notification.png'
- $bitmap = New-Object System.Drawing.Bitmap 96, 96
- $canvas = [System.Drawing.Graphics]::FromImage($bitmap)
- $canvas.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
- $canvas.Clear([System.Drawing.Color]::Transparent)
- $canvas.ScaleTransform(4, 4)
- $stroke = New-Object System.Drawing.Pen ([System.Drawing.Color]::White), 2
- $stroke.StartCap = [System.Drawing.Drawing2D.LineCap]::Round
- $stroke.EndCap = [System.Drawing.Drawing2D.LineCap]::Round
- $stroke.LineJoin = [System.Drawing.Drawing2D.LineJoin]::Round
- $outline = New-Object System.Drawing.Drawing2D.GraphicsPath
- try {
- $outline.AddBezier(18, 8, 18, 4.7, 15.3, 2, 12, 2)
- $outline.AddBezier(12, 2, 8.7, 2, 6, 4.7, 6, 8)
- $outline.AddBezier(6, 8, 6, 15, 3, 16, 3, 18)
- $outline.AddLine(3, 18, 21, 18)
- $outline.AddBezier(21, 18, 21, 16, 18, 15, 18, 8)
- $outline.CloseFigure()
- $canvas.DrawPath($stroke, $outline)
- $canvas.DrawArc($stroke, 10, 18, 4, 4, 30, 120)
- $bitmap.Save($assetPath, [System.Drawing.Imaging.ImageFormat]::Png)
- } finally {
- $outline.Dispose()
- $stroke.Dispose()
- $canvas.Dispose()
- $bitmap.Dispose()
- }
|