chia sẻ

Capture the Screen using C#


using System.Drawing.Imaging;


private static Bitmap ScreenImage; 

private static Graphics ScreenGraphic;



private void CaptureScreen()

{

ScreenImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);



ScreenGraphic= Graphics.FromImage(ScreenImage); //Convert from image to graphic



ScreenGraphic.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);



ScreenImage .Save(AppDomain.CurrentDomain.BaseDirectory + "MyScreenShot", ImageFormat.Png);



}

Không có nhận xét nào:

Đăng nhận xét

 
Ky nang ban hang ky-nang-ban-hang
10 10 1125 (c) by
Google Thủ thuật, hacking, tool, code, công cụ