19,468
社区成员
发帖
与我相关
我的任务
分享
BITMAPINFOHEADER bmih;
bmih.biSize = sizeof(bmih);
bmih.biHeight = -bmpDy;
bmih.biWidth = bmpDx;
bmih.biPlanes = 1;
// we could create this dibsection in monochrome
// if the printer is monochrome, to reduce memory consumption
// but splash is currently setup to return a full colour bitmap
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = 0;
bmih.biXPelsPerMeter = bmih.biYPelsPerMeter = 0;
bmih.biClrUsed = bmih.biClrImportant = 0;
unsigned char* bmpData = bmp->data();
//::SetStretchBltMode(hdc,COLORONCOLOR);
::StretchDIBits(hdc,
// destination rectangle
leftMargin, topMargin, pageDx, pageDy,
// source rectangle
0, 0, bmpDx, bmpDy,
bmpData,
(BITMAPINFO *)&bmih,
DIB_RGB_COLORS,
SRCCOPY);