HBITMAP hCustomBmp = CreateCompatibleBitmap(window.hDC, WIDTH, HEIGHT); //创建一副与当前DC兼容的位图
BITMAPINFO bmpInfo;
BITMAPINFO bmpInfo;
bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpInfo.bmiHeader.biWidth = WIDTH;
bmpInfo.bmiHeader.biHeight = HEIGHT;
bmpInfo.bmiHeader.biPlanes = 1;bmpInfo.bmiHeader.biCompression = BI_RGB;
bmpInfo.bmiHeader.biBitCount = 32;
SetDIBits(window.hDC, hCustomBmp, 0, HEIGHT, g_resultBuf.data, &bmpInfo, DIB_RGB_COLORS);使用指定的DIB颜色数据来设置位图中的像素
HDC hh = CreateCompatibleDC(NULL);
SelectObject(hh, hCustomBmp);
//BitBlt(window.hDC, 0, 0, WIDTH, HEIGHT, hh, 0, 0, SRCCOPY);
StretchBlt(window.hDC, 0, 0, window.init.width, window.init.height, hh, 0, 0,WIDTH,HEIGHT,SRCCOPY);
DeleteObject(hCustomBmp);
DeleteDC(hh);