GDI bitmap printing got broken sometime after Feb 2021?

Peter Koller 21 Reputation points
2021-04-03T07:24:45.763+00:00

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 - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful