General TRichView support forum. Please post your questions here
Marsianin
Posts: 193 Joined: Sun Sep 25, 2005 11:03 pm
Post
by Marsianin » Sat May 16, 2009 7:44 pm
I want to insert picture to RichViewEdit from PngImageList (Png Components adapted for Delphi 2009).
And it seems I'm doing something wrong here because I'm getting EInvalidPointer on application exit but image inserts and saves fine.
Code: Select all
RichViewEdit1.InsertPicture('',ImageList1.PngImages.Items[10].PngImage,rvvaAbsBottom);
May be I forgot something or inserting picture is not so trivial?
Sergey Tkachenko
Site Admin
Posts: 17571 Joined: Sat Aug 27, 2005 10:28 am
Contact:
Post
by Sergey Tkachenko » Mon May 18, 2009 6:40 pm
TRichView frees inserted pictures. You need to create a copy to insert from the list:
Code: Select all
var png: TPngImage;
png := TPngImage.Create;
png.Assign(ImageList1.PngImages.Items[10].PngImage);
RichViewEdit1.InsertPicture('', png, rvvaAbsBottom);
Or, if TPngImageList is compatible with TImageList, consider using InsertBullet method instead.