Showing posts with label picturebox. Show all posts
Showing posts with label picturebox. Show all posts

How to save graphics to file from a picturebox in vb.net

Posted: Wednesday, 27 February 2013

If you're like me and you've been trying to desperately convert a picture box that uses CreateGraphics() to bitmap or any other image in VB.net, you'll find that you can't do it. The object that that creates can only seemingly be accessed by .GetHdc(), however using Bitmap.FromHbitmap(objcanvas.GetHdc()) results in an error..