question

PeterKoller-4592 avatar image
0 Votes"
PeterKoller-4592 asked Castorix31 answered

GDI bitmap printing got broken sometime after Feb 2021?

Hello,
Sometime after Feb 2021, Win GDI using PlgBlt (or BitBlt) no longer prints bitmap images. This is for different PC's and using Print to PDF as well as with a real printer. I know the code has worked for many years and has not changed, here the API calls:

 hdcMem = CreateCompatibleDC(hdc);
 SetStretchBltMode(hdc, COLORONCOLOR);
 //pbmInf = incoming bitmap
 hbm = CreateDIBSection(hdc, (LPBITMAPINFO)pbmInf, DIB_RGB_COLORS, (void**)&pbmDib, NULL, 0);
 GdiFlush();
 pbmData = _getbmpbits(pbmInf, NULL); //my code to get the data
 SetDIBits(hdc, hbm, 0, pbmInf->cy, pbmData, (LPBITMAPINFO)pbmInf, DIB_RGB_COLORS);
 SelectObject(hdcMem, hbm);
    
 //using an array of 3 prepared points
 POINT pnt[4];
 CalculateCoordinates(pnt); //my code to get the coordinates
 rc = PlgBlt(hdc, pnt, hdcMem, 0, 0, pbmInf->cx, pbmInf->cy, 0, 0, 0);

I also tried with BitBlt, same result. The image is painted on the screen, but will not print to pdf or to a printer. The application was recently High Resolution enabled, does that make a difference?

What has changed, and how can I fix it? Or, is this problem known, and/or will it be fixed?

Applies to:
Edition Windows 10 Pro
Version 20H2
Installed on ‎14/‎10/‎2020
OS build 19042.867
Experience Windows Feature Experience Pack 120.2212.551.0

Kind Regards,
Peter

windows-api
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.