Tag: 抓屏幕截图

如何捕捉屏幕的一部分

我正在使用win32 PrintWindow函数将屏幕捕获到BitMap对象。 如果我只想捕获窗口的某个区域,我该如何在内存中裁剪图像? 这是我用来捕获整个窗口的代码: [System.Runtime.InteropServices.DllImport(strUSER32DLL, CharSet = CharSet.Auto, SetLastError = true)] public static extern int PrintWindow(IntPtr hWnd, IntPtr hBltDC, uint iFlags); public enum enPrintWindowFlags : uint { /// /// /// PW_ALL = 0x00000000, /// /// Only the client area of the window is copied. By default, the entire window is copied. /// PW_CLIENTONLY = 0x00000001 […]