Adding PNG Images Using TPicture Assignment

  • Hi,

    With WPTools v7.28 and Delphi 2010, I am using the following code to add images to an RTF document that works well with Bitmap and JPEG types but not with PNG images. What do I need to do to fix this?


    'vRegRptImage.Image' is a TPicture property that displays using assignment to a TImage on a form. Also using 'vImg.LoadFromFile(...)' on the original PNG file works but is not what I need to do.

    Steve

  • Thanks for confirming that I should use LoadFromStream. I had tried that approach before but I think I forgot to reset the stream position after saving to the stream. So using the following code works:


    Thanks again.
    Steve