Reputation: 323
I have a window which I can resize. I want to print a full snapshot of this window, regardless of the size of the window. For example:
Window is normally 800 x 600 but can be as small as 300 x 300 but I still want to print at 800 x 600 pixels.
When I use Graphics mygraphics = this.CreateGraphics()
I get a small image not at the desired size.
Upvotes: 0
Views: 116
Reputation: 81620
You probably need to hold the "graphic" in a background bitmap:
Bitmap myImage = new Bitmap(800, 600);
And to draw on it:
using (Graphics g = Graphics.FromImage(myImage)) {
// do stuff:
}
Upvotes: 1