Ticket S34199
Visible to All Users

RAD Studio 2009 and later - Make TdxPNGImage class registration optional for loading PNG images

created 15 years ago

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.

Answers approved by DevExpress Support

created 8 years ago (modified 7 years ago)

Hello Sven,

You can use the following algorithm to disable this functionality in v17.1.3:

  1. Install VCL 17.1.3.
  2. Open the <DevExpressInstallatioFolder>\ExpressCore Library\Sources\cxVer.inc file.
  3. 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.
  4. After the compilation is finished, launch your IDE, create a new application, and place the TImage control on the main form.
  5. Load the PNG picture into the TImage.Picture property.
  6. 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.
    Show previous comments (3)

      … and again…

        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.

        DevExpress Support Team 6 years ago

          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.

          created 15 years ago (modified 12 years ago)

          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.

            Show previous comments (25)

              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.

                DevExpress Support Team 7 years ago

                  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.

                  Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                  Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.