blah blah blah is here! blah blah » Close

216 views

Screenshot

up0down
link

How can I obtain a bitmap (or jpg or png or...) of my application window?

last answered one year ago

1 answers

link

i think you need to make a print screen so a way is to use the

System.Windows.Forms.SendKeys.Send("{PRTSC}");


or you can print the form by using the graphics:
void PrintForm()
{
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new System.Drawing.Rectangle(0, 0, this.Width, this.Height));
bmp.Save("C:\\myImage.png", System.Drawing.Imaging.ImageFormat.Png);
}

Feedback