$null = [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$bmp = New-Object System.Drawing.Bitmap(24, 20)
$font = New-Object Drawing.Font 'Courier Regular',20,0,2
$graphic = [drawing.graphics]::FromImage($bmp)
$graphic.DrawString(42, $font,[drawing.brushes]::White, 0, 0)
$rect = new-object drawing.Rectangle (0, 0, $bmp.Width, $bmp.Height)
[Drawing.Imaging.BitmapData]$bd = $bmp.LockBits($rect,
[Drawing.Imaging.ImageLockMode]::ReadOnly,
[Drawing.Imaging.PixelFormat]::Format1bppIndexed)
$bp = New-Object Drawing.Bitmap (24, 20, $bd.Stride,
[Drawing.Imaging.PixelFormat]::Format1bppIndexed,
$bd.Scan0)
foreach($y in 0..19) {
foreach($x in 0..23) {
if($bp.GetPixel($x, $y).r) { $p = '42' }
else { $p = ' ' }
Write-Host $p -NoNewline
}
Write-Host "`n" -NoNewline
}