PNG won't add to doc, but jpg and bmp will (delphi XE)

  • I have wpObj_Image in my uses clause, it has DEFINE PNGLIB defined. I can select png, bmp and jpg files. The latter 2 types will add to the document and display, but the png won't. You can see the text expand and then immediately shrink when WPRichText1.TextObjects.Insert(img) is executed.

    Code
    procedure TfrmEditTemplate.actnODgraphicAccept(Sender: TObject);
    var
      img: TWPOImage;
    begin
      img := TWPOImage.Create(WPRichText1.Memo.RTFData);
      img.LoadFromFile(actnODgraphic.Dialog.FileName);
      WPRichText1.TextObjects.Insert(img);
    end;

    By the way, PNGDELPHI is no longer available. Codegear challenged it, and asked for it to be removed from free downloads.