[C#] 擷取螢幕畫面
將目前畫面擷取下來另存一張點陣圖(bitmap)public void CaptureScreen(){
System.Drawing.Size size = Screen.PrimaryScreen.Bounds.Size;
System.Drawing.Bitmap bitmap
= new System.Drawing.Bitmap(size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);
g.CopyFromScreen(0, 0, 0, 0, size);
bitmap.Save("screen.png", System.Drawing.Imaging.ImageFormat.Png);
}
頁:
[1]