Convert graphic that is created on a specific control to Bitmap
How can I convert a graphic, c开发者_StackOverflow社区reated on a PictureBox, to Bitmap?
You need to draw directly on a Bitmap
object by calling Graphics.FromImage
, then set the Bitmap
as the PictureBox's Image
.
Or if you want to create a Bitmap object:
Bitmap myBitmap = new Bitmap(pictureBox1.Image);
try pictureBox1.Image.Save(..)
精彩评论