Page 1 of 1

How to replace Text with Animated Gif Image

Posted: Fri Jan 30, 2009 2:22 pm
by Kassit
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 :

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;
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

Posted: Fri Jan 30, 2009 5:40 pm
by Sergey Tkachenko
If you want to implement a chat window, look here:
http://www.trichview.com/forums/viewtopic.php?t=63

Posted: Fri Jan 30, 2009 7:47 pm
by Kassit
I'd looked at that before.

It's not very satisfied to adding some characters to viewable texts by users like "\u". in addition it is not possible to apply style to the selected text in that example.

also the problem to showing animated Gif will not solve