alogrep 0 Posted September 10, 2022 Hi all. I have installed version 11.2 and now I get error at runtime with buttons that have a pngobject. In the Form the image shows. In the object inspector it does show Tpngobject, and a click on it shows the miniature image. but at runtime it shows that the picture graphic is not assigned. Perhaps there is a new Pngcomponents.dpk required for version 11.2> Uwe Raabe. any ideas? Share this post Link to post
FPiette 385 Posted September 11, 2022 What is exactly the error you get? What is the call stack at the time of error? Share this post Link to post
Uwe Raabe 2064 Posted September 11, 2022 TPngObject is outdated since D2009 and replaced with TPngImage. PngComponents allows to register TPngObject as a class directly derived from TPngImage when RegisterOldPngFormat is defined. There are other libraries that do something similar and it is mandatory to stick to only one of these. Otherwise strange things can happen. Share this post Link to post
alogrep 0 Posted September 12, 2022 François Piette i get AV b/c the image.picture..graphic is Null. Yet at design yime the image shows ok. Share this post Link to post
alogrep 0 Posted September 12, 2022 Uwe Raa, hi. I use the PngComponents you suggested to me. the Alexandria package. all worked ok with version 11.15, after I installed ver 11.2 (Delphi) it broke. Share this post Link to post
Uwe Raabe 2064 Posted September 12, 2022 Can you attach one of the images producing the error? Share this post Link to post
alogrep 0 Posted September 12, 2022 Thanks, Uwe Please, note: I re-downloaded https://codeload.github.com/UweRaabe/PngComponents/zip/refs/heads/master and re-installed and re-build the packages. Design.jpg shows what I see at design time. Formcreate.jpg shows that the picture.graphic "disappeared": NIL Error.jpg show the error I obviously (since graphic "disappeared") get. Share this post Link to post
Uwe Raabe 2064 Posted September 12, 2022 The (TPNGObject) reference in the Object Inspector implies that the DFM contains an old TPNGObject instance. This can happen when that DFM was created in a Delphi version before D2009 or with the old PngObjects library. Since Delphi 2009 the corresponding graphic class is named TPngImage. The PngComponents packages are by default compiled with RegisterOldPngFormat defined. Unless you define the same in your application it cannot recognize the TPNGObject instance in the DFM. To convert from TPNGObject to TPngImage simply open the image in the IDE designer as you already did. Then save the image to disk and load it again. After that the Object Inspector should have (TPngImage) and your application will work without the define mentioned above. Share this post Link to post
alogrep 0 Posted September 12, 2022 Thanks again Uwe. (I amd converting a very large project and I need a couple of months more of compatibility betweenXE and legacy Delphi) When I put RegisterOldPngFormat in Conditional defines of the App and I build I get this error: [dcc32 Fatal Error] POS.dpr(1): F1027 Unit not found: 'System' or binary equivalents (.dcu) The .dcu created by pngcomponents package are in C:\hmxe\png\PackagesAlexandria\Win32\Release. I tried to add this directory to the search path, but I get the same error. Share this post Link to post