Save content of picturebox?

G

Guest

I use drawline and drawstring to create something in a picturebox and want to
save the content of that picturebox as a bitmap, is that possible and how?

Thank.
 
H

Herfried K. Wagner [MVP]

John said:
I use drawline and drawstring to create something in
a picturebox and want to save the content of that
picturebox as a bitmap, is that possible and how?

Instead of drawing to the picturebox' 'Graphics' object, draw to a bitmap's
'Graphics' object:

\\\
Dim b As Bitmap = New Bitmap( _
100, _
100, _
PixelFormat.Format32bppArgb _
)

Dim g As Graphics = Graphics.FromImage(b)
g.DrawImage(ba, 0, 0)
g.FillEllipse( _
Brushes.Red, _
0.0F, _
0.0F, _
b.Size.Width, _
b.Size.Height _
)
g.Dispose()
b.Save(...)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top