Question Make bitmap from picturebox

TwentySix

New member
Joined
Apr 10, 2012
Messages
1
Programming Experience
1-3
Hi.

I'm drawing text on picturebox with e.Graphics.DrawString("test", drawFont, blackBrush, 0, 0) command.
How can I make bitmap (Dim mybitmap As Bitmap) with that text from picturebox?
 
Option 1:
Create a Bitmap object, use picturebox DrawToBitmap method.
Option 2:
Create a Bitmap object or use one from an image, get Graphics object using Graphics.FromImage method, use that Graphics object to draw same operations as with Paint handler.
If you for example have a method that takes a Graphics object as parameter you can call that both from Paint handler and when you need to draw same operations to the Graphics representing a bitmap.
 

Latest posts

Back
Top