1 2 3 4 5 6 7 8 9 10 11
|
public Bitmap CapturerBureauWindows()
{
Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
bmpScreenshot.Save(@activeDir + "\\" + "img_0.png", ImageFormat.Png);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpScreenshot.Save(@activeDir + "\\" + "img_1.png", ImageFormat.Png);
return bmpScreenshot;
} |
Partager