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?
Code
vRtfEdit := TWPCustomRtfEdit.CreateDynamic;
...
vObj := nil;
vImg := TWPOImage.Create( vRtfEdit );
try
vImg.Picture.Assign( vRegRptImage.Image );
vObj := vPar.AppendNewObject(wpobjImage, false, false, 0 );
vObj.ObjRef := vImg;
vObj.Width := vImg.ContentsWidth - trunc( vImg.ContentsWidth * 0.3 );
vObj.Height := vImg.ContentsHeight - trunc( vImg.ContentsHeight * 0.3 );
except
vObj.Free;
vImg.Free;
end;
Alles anzeigen
'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