Search notes:

System.Drawing.Bitmap (class)

System.Drawing.Bitmap encapsulates a GDI+ bitmap.

Creating a png with PowerShell

The following simple example tries to demonstrate how a png can be created with PowerShell. (By default, the Save() method of System.Drawing.Bitmap (which is implemented in the base class System.Drawing.Image) creates a png rather than a bmp!)
add-type -assembly 'System.Drawing'

$bmp = new-object Drawing.Bitmap 200, 40

$canvas = [Drawing.Graphics]::FromImage($bmp);

$brushRect = new-object Drawing.SolidBrush ([Drawing.Color]::FromArgb(255, 255, 240, 150));
$canvas.FillRectangle($brushRect, [Drawing.Rectangle]::FromLTRB(0, 0, 300, 200));

$brushPen  = new-object Drawing.SolidBrush ([Drawing.Color]::FromArgb(255, 255, 120,  20));
$pen       = new-object Drawing.Pen $brushPen, 3
$canvas.DrawRectangle($pen, [Drawing.Rectangle]::FromLTRB(1, 1, 198, 38));

$font      = new-object Drawing.Font "Courier New", 16, ( [Drawing.FontStyle]::Bold )
$brushFont = new-object Drawing.SolidBrush ([Drawing.Color]::FromArgb(255,  50,  90, 230));
$canvas.DrawString("Hello world", $font, $brushFont, 22, 8)

$bmp.Save("$(get-location)\img\Hello-world.png");
Github repository .NET-API, path: /System/Drawing/Bitmap/Hello-world.ps1
When executed, the script produces

See also

An instance of System.Drawing.Bitmap is returned by the PowerShell cmdLet get-image … -format image.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1759399815, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/Drawing/Bitmap/index(63): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78