Png Image won't load

  • Hi,

    I'm sure this used to work. I'm using XE2 and WPTools Premium 6.28.

    In WPINC.INC I have:

    {.$DEFINE GRAPHICEX}
    {$DEFINE PNGIMG}

    In my app i use PngImage.

    My code is:

    WPRichText1.Changing;
    Img:=TWPOImage.Create(WPRichText1.Memo.RTFData);
    Img.LoadFromFile(whatever);
    WPRichText1.TextObjects.Insert(Img);
    WPRichText1.ChangeApplied;

    It works for a jpg but not for a png. I just get a blank image of the correct size.

    Any help greatly appreciated.

    Ken

    • Offizieller Beitrag

    Hi,

    All the demos load PNG - but of course they need the PNG Image installed, unless using XE2 or later.

    Maybe there is something special with that test PNG file or maybe it is required to set the width and height after loading it. Maybe a ReformatAll is missing to display it.

    But I tested that code and it worked on the WPTools 6 I used.

    Julian