2014-02-09 126 views

回答

1

嘗試Screen.PrimaryScreen.WorkingArea它可以讓你的屏幕不包括任務欄

Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.WorkingArea.Width, 
          Screen.PrimaryScreen.WorkingArea.Height, 
          PixelFormat.Format32bppArgb); 

Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot); 


gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.WorkingArea.X, 
          Screen.PrimaryScreen.WorkingArea.Y, 
          0, 
          0, 
          Screen.PrimaryScreen.WorkingArea.Size, 
          CopyPixelOperation.SourceCopy); 

bmpScreenshot.Save("Screenshot.png", ImageFormat.Png); 

Screen.WorkingArea Property

獲取顯示器的工作區域。工作區域是顯示器的桌面 區域,不包括任務欄,停靠窗口和停靠的工具欄 。

相關問題