HBITMAP转QByteArray读图
从几篇文章拼出来的,自己存一份
{ HWND hWnd = GetConsoleWindow(); HDC hDc, hDcMem; hDc = GetDC(hWnd);
hDcMem = CreateCompatibleDC(hDc);
BITMAP bitmap; GetObject(hBitmap, sizeof(BITMAP), &bitmap); SelectObject(hDcMem, hBitmap); BitBlt(hDc, 0, 0, bitmap.bmWidth, bitmap.bmWidth, hDcMem, 0, 0, SRCCOPY);
BITMAPINFOHEADER bitmapInfoHeader; memset(&bitmapInfoHeader, 0, sizeof(bitmapInfoHeader)); bitmapInfoHeader.biBitCount = bitmap.bmBitsPixel; b
共有 0 条评论