In recent changes to my sofware I am randomly getting black blocks instead of BMP graphics when using PaintGraphicEx on the TPrintPreview component.
I have been using TPrintPreview in the development of Delphi7-compiled business management software for a company for more than 10 years. (Best postcard I ever sent - thanks, Kambiz!) To-date I was using Preview v4.75 but after the problem occurred, I have tried v5.70 and v5.90 unsuccessfully. Suprisingly, attempts to re-create the previous revision of my software using saved source code did not get rid of the problem.
BMPs (e.g. the company logo), saved as resources in my .exe file, are copied to the TPrintPreview component using PrintGraphicEx. Most of the time this works. But after some program usage, it seems something goes wrong and images predominantly appear as black blocks. (I have checked that I am Free-ing all dynamically created objects, so as not to create memory leaks).
Errors have been seen on Windows XP, 7 and 8.1. Development/compilation has been tried under both Windows XP and Windows 7 - I'm considering porting the whole development to Windows 10 and Delphi XE10 Seattle in a hopeful attempt to kill the problem)
Any suggestions would be much appreciated.
Attached is a screenshot (with some privacy blurring) showing 4 pages of an invoice with some BMPs reproduced correctly and others showing black.
Thanks for the help!
Andrew