How to replace Text with Animated Gif Image
Posted: Fri Jan 30, 2009 2:22 pm
I want to replace a text with image in RichView.
I save formatted text of RichViewEdit into stream. therefore i want to replace something like "[img]" in text with animated gif logo and then insert it into RichView.
if found a source code that is for replacing text with image in RichViewEdit :
but there is two problems:
1- that's for replacing in RichViewEdit not RichView
2- It load images from TImageList so it impossible to insert animated gif images. ImageList just loads bitmap and icons
I save formatted text of RichViewEdit into stream. therefore i want to replace something like "[img]" in text with animated gif logo and then insert it into RichView.
if found a source code that is for replacing text with image in RichViewEdit :
Code: Select all
procedure ReplaceImages;
procedure SearchAndInsertIcon(const Code: String; ImageIndex: Integer);
begin
RVE.SetSelectionBounds(0, RVE.GetOffsBeforeItem(0), 0, RVE.GetOffsBeforeItem(0));
while RVE.SearchText(Code, [rvseoDown]) do
RVE.InsertBullet(ImageIndex, ImageList1);
end;
begin
SearchAndInsertIcon(':)', 0);
SearchAndInsertIcon(':|', 1);
SearchAndInsertIcon(':(', 2);
end;
1- that's for replacing in RichViewEdit not RichView
2- It load images from TImageList so it impossible to insert animated gif images. ImageList just loads bitmap and icons