Problem with TdxComponentPrinter (Delphi)

2019-08-27 17:41发布

问题:

TdxComponentPrinter is a componenet that allow me print a TPanel on a paper. But there is problem and when the panel contains TImage, the background of the image will be converted to black in the paper.

Before print :

After print (on the paper) :

I have tried different ways to solve this problem. for example i used Repaint; method of TPanel,... but doesn't work and the background of image is still black. I don't know why!!!

Help me please.

回答1:

This is a png file, which might not be supported completely in your Delphi version. Did you try to change it to a TcxImage which might be more compatible with the DevExpress printing system?

It also might be worth it to submit this issue to DevExpress if you can't fix it. They reply really quick and know more about their components then all of use here on SO :-)



回答2:

If it is already a jpg then you should improve the quality of the jpg. It looks like the black parts are compression artifacts where there is a mix between white and another color. If you clean up the background of the image with a paint program it will probably look a lot better.