Ok, so the easiest solution is to output the data to a memory dc, and capture tha bitmap from there..
The problem, however, is that i can't capture a bitmap of the DC.. i only get dummy data in the bits..
Code:
BITMAPINFO info;
TIFF *tif;
UINT32 w = GetDeviceCaps(dc, HORZRES);
UINT32 h = GetDeviceCaps(dc, VERTRES);
BYTE *bits = (BYTE*)malloc(w * h);
HBITMAP hBmp;
BITMAP bitty;
HDC mDC = CreateCompatibleDC(dc);
hBmp = CreateCompatibleBitmap(mDC, w, h);
SelectObject(mDC, hBmp);
BitBlt(mDC, 0, 0, w, h, dc, 0, 0, SRCCOPY);
GetObject(hBmp, sizeof(BITMAP), &bitty);
BITMAPINFOHEADER header;
header.biSize = sizeof(BITMAPINFOHEADER);
header.biWidth = w;
header.biHeight = h;
header.biPlanes = bitty.bmPlanes;
header.biBitCount = 1;
header.biCompression = BI_RGB;
header.biSizeImage = 0;
header.biClrUsed = 0;
header.biClrImportant = 0;
info.bmiHeader = header;
info.bmiColors->rgbRed = NULL;
info.bmiColors->rgbGreen = NULL;
info.bmiColors->rgbBlue = NULL;
info.bmiColors->rgbReserved = NULL;
GetDIBits(mDC, hBmp, 0, h, &bits, &info, DIB_RGB_COLORS);
After GetDIBits() all bits in the "bits" array are set to 205...
if i create a new window dc, do i have to do all the drawing again, or could i copy the original dc to the new one??