using System.Drawing.Imaging;
private static Bitmap bmpImagem;
private static Graphics gfxImagem;private void btnScreen_Click(object sender, EventArgs e)
{
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
this.Hide();
bmpImagem = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
gfxImagemt = Graphics.FromImage(bmpImagem);
gfxImagem.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpImagem.Save(saveScreenshot.FileName, ImageFormat.Png);
this.Close();
}
}
Nenhum comentário:
Postar um comentário