Jump to content
alogrep

Trying moving from TpngObject to Vcl.Imaging.pngimage.TPngImage

Recommended Posts

I need help again with pngimage.
I have some custom control containing a Tpicture.
The Pictures were loaded as TpngObject.
I was told (Uwe Raabe)
that if I load and then save the form containing the controls, they would be saved as Tpngimage.
Or maybe I misunderstood.
The problem is that the picture graphic is not loaded at all in the dfm.
If I inspect the dfm in Delphi IDE it does not have the line
   Glyphs.Glyph.Data = {
at all (glyphs,glyph is the Tpicture.).
If I inspect with with Notepad I see
    Glyphs.Glyph.Data = {
      0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000004E00
      00004E08060000008EAA201D000020CD4944415478DAED9C079414759EC7BFD5
      69BA7B72C    etc. 

However, if I do not save the dfm, at run time the image in Glyphs,Glyph is shown,

although at design time is not present in the dfm.

I am totally lost,
I tried to remove all TpngObject reference from the project, but nothing changed.
Can anyone help? How can I save the pngobject in the controls to the Vcl.Imaging.pngimage.TPngImage?

Share this post


Link to post

To get any DFM containing the old TPNGObject loaded you need to install TPngComponents. Make sure that RegisterOldPngFormat is in the Defines (it should be by default).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×