Skip to content

Instantly share code, notes, and snippets.

@c-yan
Created June 16, 2018 09:12
Show Gist options
  • Save c-yan/c1e4b367db0636ede68a662b110b5584 to your computer and use it in GitHub Desktop.
Save c-yan/c1e4b367db0636ede68a662b110b5584 to your computer and use it in GitHub Desktop.
script for creating circle cut of M3
[IO.Directory]::SetCurrentDirectory((Get-Location).Path)
Add-Type -AssemblyName System.Drawing
$b = new-object System.Drawing.Bitmap 650, 1000
$g = [System.Drawing.Graphics]::FromImage($b)
$g.Clear([System.Drawing.Color]::White)
$f = new-object System.Drawing.Font "Noto Sans CJK JP Regular", 45
$g.TextRenderingHint = [System.Drawing.Text.TextRenderingHint]::AntiAlias
$g.DrawString("みゃねっと", $f, [System.Drawing.Brushes]::Black, (new-object System.Drawing.PointF 50, (400 - 20)))
$f.Dispose()
$f = new-object System.Drawing.Font "Noto Sans CJK JP Regular", 34
$g.DrawString("チップチューンあります", $f, [System.Drawing.Brushes]::Black, (new-object System.Drawing.PointF 50, (550)))
$g.DrawString("http://m.cyanet.jp/", $f, [System.Drawing.Brushes]::Black, (new-object System.Drawing.PointF 50, (825 + 20)))
$f.Dispose()
$g.FillRectangle([System.Drawing.Brushes]::Black, (new-object System.Drawing.Rectangle (700 - 350 + 50 - 20 - 24) , (100 - 20 + 20 - 10 ), 244, (176 + 7)))
$g.FillRectangle([System.Drawing.Brushes]::Gray, (new-object System.Drawing.Rectangle (700 - 350 + 50 - 20 - 24), (100 - 20 + 20 + 89 - 10), 244, 5))
$f = new-object System.Drawing.Font "Noto Sans CJK JP Regular", 40
$g.DrawString("Lo-Res", $f, [System.Drawing.Brushes]::White, (new-object System.Drawing.PointF (700 - 350 + 50 - 24 + 3), (100 + 20 - 4 - 5 + 3 - 10)))
$g.DrawString("AUDIO", $f, [System.Drawing.Brushes]::White, (new-object System.Drawing.PointF (703 - 350 + 50 - 24 + 3), (160 + 20 + 7 + 4 + 5 + 11 - 10)))
$f.Dispose()
$b.Save("circlecut.png", [System.Drawing.Imaging.ImageFormat]::Png)
$b.Dispose()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment