Tag: getdibits

hwnd到ppm问题

我有一个将hwnd保存到ppm文件的function。 此函数的灵感来自msdn示例。 msdn示例和我的函数都工作但是…我有一个问题…… 但首先,这是function。 int CaptureAnImage(HWND hWnd) { HDC hdcWindow; HDC hdcMemDC = NULL; HBITMAP hbmScreen = NULL; RECT rc; BITMAPINFOHEADER bi; DWORD dwBmpSize; HANDLE hDIB; char *lpbitmap; int w, h; FILE *f; // Retrieve the handle to a display device context for the client // area of the window. hdcWindow = GetDC(hWnd); // Create […]