This report is based upon the discussion in report Delphi 2010 always uses the TdxPNGImage class for loading PNG images (this corrupts form streaming).
Proposed Solution:
Introduce a compiler directive for Delphi 2009+, to define whether the TdxPNGImage class is registered for loading PNG images, or not.
RAD Studio 2009 and later - Make TdxPNGImage class registration optional for loading PNG images
Answers approved by DevExpress Support
Hello Sven,
You can use the following algorithm to disable this functionality in v17.1.3:
- Install VCL 17.1.3.
- Open the <DevExpressInstallatioFolder>\ExpressCore Library\Sources\cxVer.inc file.
- Apply the following changes to that file.
//{$DEFINE DXREGISTERPNGIMAGE}
4. Save the file and run our <DevExpressInstallatioFolder>\Setup\Setup.exe file in Recompile (not Repair) mode. - After the compilation is finished, launch your IDE, create a new application, and place the TImage control on the main form.
- Load the PNG picture into the TImage.Picture property.
- As a result, you will see the TPngImage class in your Object Inspector (I have tested this approach with my Delphi Seattle).
Please keep me informed of your progress.
I, too, am having an issue. Our images are becoming TdxPNGImage types instead of TPNGImage types.
The problem we are having is that the forms were made years ago and all the images are TPNGImage types, but the newer TdxPNGImage will never appear on our forms.
I've tried the method for removing the DXREGISTERPNGIMAGE defined in cxVer.inc, but that has not corrected the issue. Images still show up as TdxPNGImage types.
I've looked into dxGDIPlusClasses.pas and I noticed that there is an IFNDEF statement that still registers the PNG files as a smart image! So damned if you do, damned if you don't.
Still need a workaround. Tried a few things but to no avail and I'm at my wits end on how to get my PNG images to appear in the object inspector as TPngImage types instead of TdxPngImage types.
Even though I have DevExpress 17.1.8 installed and followed the procedure to allow for standard PNG files, it just doesn't respect it. This is a new machine, so there are no other VCL DevExpress components that were previously installed. However, I also have DevExpress installed for .NET, but I would think the two would not in any way intermingle (I can see the code bases exist in two separate folders). So, why is this not working as indicated when removing the DEFINE from cxVer.inc for me in the Embarcadero platform (Berlin 10.1 Update 2)?
Thanks in advance for any help you can provide.
Hello,
I've created a separate ticket on your behalf (T803894: Images become TdxPNGImage instead of TPNGImage types). It has been placed in our processing queue and will be answered shortly.
To disable our TdxPNGImage class registration in RAD Studio 2009 and later, and allow the IDE to load .PNG images using a built-in functionality, do the following:
- Comment out {$DEFINE DXREGISTERPNGIMAGE} in the dxGDIPlusClasses unit.
- Run our VCL Product Setup in Recompile mode.
Dear Support,
with latest 17.1.8 I receive this problem, although I did as above mentioned: //{$DEFINE DXREGISTERPNGIMAGE} and run recompile. Still I get this message. It worked for many years now, something changed here. Can you please advise…
…deleted all bpls and dcus now and run recompile and still it does not work. Why you don't improve this, when more than one people have this problem here? What else can I do now? Before answering, please read what I've done already and don't start with things I checked already. As I said, it worked for many years now.
Hello,
I have reviewed both your comments. You are saying the you still get this message. Would you please specify the message text and the moment when you get this message? Is it a compilation error? Can you reproduce this message only with your project or also with a small demo?
I have tested the step-by-step approach I suggested in this ticket with the 17.1.8 version of our controls. On my machine, it works correctly. Would you please ensure that you modify the cxVer.inc file that resides in the *<DevExpressInstallatioFolder>\ExpressCore Library\Sources* folder, but not in other folders (files with this name are created for each IDE you have, but only the <DevExpressInstallatioFolder>\ExpressCore Library\Sources\cxVer.inc file should affect the DXREGISTERPNGIMAGE option)?
In addition, I suggest that you check if the approach I suggested in the Reinstalling VCL products from scratch ticket can help you completely delete our packages before reinstalling 17.1.8. Perhaps, some old packages are still present somewhere in your system.
Please keep me informed of your progress.