-
private void button1_Click( object sender, EventArgs e)
-
{
-
Bitmap screenshot = new Bitmap (Width, Height, PixelFormat. Format32bppArgb );
-
Graphics graph = Graphics.FromImage (screenshot);
-
graph.CopyFromScreen (Location.X, Location.Y, 0, 0, Size, CopyPixelOperation.SourceCopy );
-
SaveFileDialog sfd = new SaveFileDialog ( );
-
sfd.Filter = "Image File (*.png) | *.png";
-
if (sfd.ShowDialog ( ) == DialogResult.OK )
-
{
-
string filename = sfd.FileName;
-
screenshot.Save (filename);
-
}
-
}
|