#SOLVED (SEE #SOLUTION HASHTAG ON COMMENTS)

#SOLVED (SEE #SOLUTION HASHTAG ON COMMENTS)

Hello everyone!

Someone could tell me why if my IDE dll expert have any of the PNG Components, i receive the message "Invalid graphic format" if I try to use some of these components at any other project?

A better explanation:

I've created an IDE expert (dll) to do some cool stuff. On the dialogs of this expert I used some PNGComponents (TPngBitBtn, TPngSpeedButton) to improve my interface with nice buttons with alpha blended PNG. This expert works good and I guess it is correctly installed.

With my expert installed, I simply start a new project (new vcl forms application) and drop a TPngBitBtn to start. After that, I try to add the png image on it and, after confirm the image (Picture Editor) the error Invalid graphic format is shown.

If I remove from my dll expert the forms with PNG components, reinstall the expert and do the same from the previous paragraph. The error do not occurs.

Someone can help Me?

Comments

  1. Uwe Raabe, i saw you interation on this thread (https://plus.google.com/107032218922460039706/posts/Up4P5y4pWcS) but there were no conclusion there, so I do not know if that was solved. My Delphi is XE5 and the problem occurs on Delphi 2006 also (need confirmation)

    ReplyDelete
  2. Carlos Barreto Feitoza Filho did you try Uwe suggestion?

    "The GLScene project contains a unit PictureRegisteredFormats.pas that hacks into FileFormats."

    ReplyDelete
  3. Well, I can only guess. I assume you compile your expert with packages. Do you have PngComponents added to the package list of your expert? Otherwise you end up with two instances of the code causing lots of problems.

    ReplyDelete
  4. Hello, Mr. Raabe. My expert is a DLL expert and It uses a lot of OTA, so I had to use the ToolsApi unit, and to do so, i had must link with runtime packages, however there are only one runtime package listed: designide. Are you saying that I need to add the pngcomponents runtime package also? Sorry my rough english.

    ReplyDelete
  5. Carlos Barreto Feitoza Filho Yes, that is what I meant. Any package listed there will automatically add all packages implicitly used by it. Therefore you don't need to list VCL, RTL and so. PngComponents is different, because it is not used by the designide package. So you have to add it manually to that list.

    ReplyDelete
  6. Uwe Raabe I will do some tests now! Thank You!

    ReplyDelete
  7. #SOLUTION

    As Uwe Raabe said, the problem was being caused by the lack of PNG Components Runtime Package on the runtime packages list of my expert DLL. Placing the runtime package there solves the problem. Tank you Mr. Raabe :)

    ReplyDelete
  8. Now I know that I need more knowledge about using of Runtime Packages, because despite the correction, now I'm confused. Why I need to list the PNG Components Runtime Packege to use it at runtime, but I do not need another Delphi Packages. I mean, I'm using a lot of components (TEdit, TMemo, TListBox). For these components I would not need to use some Runtime Package also? Uwe Raabe can you indicate some online material about that? I need to learn...

    ReplyDelete
  9. Carlos Barreto Feitoza Filho I already gave a hint in my first comment: Each package mentioned in this list will automatically make use of all packages required by itself. The designide package requires a good part of the VCL and RTL packages so they are seen as if they were explicitly listed. PngComponents is unknown to designide and thus not required by it. Therefore you have to mention it in the list itself.
    You can see which packages are effectively used by your DLL when you select the "Information for " in the Project menu after compiling it.

    ReplyDelete

Post a Comment