jmasterx
jmasterx

Reputation: 54113

Drawing to and saving a png in vb .net

How could I create a bitmap which is initially completely transparent. I would then like to do some drawing to it, like g.drawImage() and then I would like to save it as a png. How could I do this?

Thanks

Upvotes: 1

Views: 13124

Answers (1)

AndyPerfect
AndyPerfect

Reputation: 1180

Dim bmp As New Bitmap(width, height)
Dim g As Graphics = Graphics.FromImage(bmp)
g.Clear(Color.Transparent)

''Perform Drawing here

bmp.Save("ZOMG AMAZING DRAWING.png", System.Drawing.Imaging.ImageFormat.Png)

Upvotes: 3

Related Questions