Reputation: 13
How can I copy the image in the clientrectangle of my form to a bitmap in memory? I know how to go from bitmap to form, but not the other way around. Thanks!
Upvotes: 1
Views: 2069
Reputation: 941635
You can use the DrawToBitmap() method. Mostly works, but you might have controls that don't implement it, like RTB or 3rd party controls. The backup method is Graphics.CopyFromScreen().
Upvotes: 1
Reputation: 13897
Assuming you're referring to the BackgroundImage property of the form.
var bmp = ((Bitmap)this.BackgroundImage);
Upvotes: 0