gif image

General TRichView support forum. Please post your questions here
Post Reply
gcw5zb
Posts: 5
Joined: Thu Sep 08, 2005 8:52 am

gif image

Post by gcw5zb »

why i insert a gif image,but it can't be active?
my code is like this:
gif:=TGifImage.Create;
gif.LoadFromFile('0020.gif');
rich.InsertPicture('0020.gif',gif,rvvaBaseLine);
rich.Format;
Sergey Tkachenko
Site Admin
Posts: 17306
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1) Include RVGifAnimate unit in the project or in the uses clause of one of your units
2) Set rich.AnimationMode=rvaniOnFormat

And do not call Format after Insert*** methods. They are editing-style methods, they reformat the changed part of document themselves.
In this case, Format only slows down the execution, and moves caret to the beginning of the document.
gcw5zb
Posts: 5
Joined: Thu Sep 08, 2005 8:52 am

Post by gcw5zb »

Sergey Tkachenko wrote:1) Include RVGifAnimate unit in the project or in the uses clause of one of your units
2) Set rich.AnimationMode=rvaniOnFormat

And do not call Format after Insert*** methods. They are editing-style methods, they reformat the changed part of document themselves.
In this case, Format only slows down the execution, and moves caret to the beginning of the document.
i don't have this unit,and the commpnent doesn't have the property name AnimationMode,Why?
Sergey Tkachenko
Site Admin
Posts: 17306
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Update it to the newer version
gcw5zb
Posts: 5
Joined: Thu Sep 08, 2005 8:52 am

Post by gcw5zb »

Sergey Tkachenko wrote:Update it to the newer version
why it can't move?!
uses GIFImage, RVAnimate;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
gif:TGIFImage;
begin
rich.AnimationMode:=rvaniOnFormat;
gif:=TGifImage.Create;
gif.LoadFromFile('0020.gif');
rich.InsertPicture('0020.gif',gif,rvvaBaseLine);

end;
i have updated!
Sergey Tkachenko
Site Admin
Posts: 17306
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Add RVGifAnimate in "uses", not RVAnimate.
xa0c
Posts: 1
Joined: Mon Jan 09, 2006 5:48 am
Contact:

Post by xa0c »

it's not working... for example:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  gif: TGifImage;
begin
gif := TGIFImage.Create;
gif.LoadFromFile('d:\1.gif');
RichView1.AnimationMode := rvaniOnFormat;
RichView1.AddPictureExTag('', gif, -1, rvvaBaseline, 1);
RichView1.FormatTail;
end;
if i set AnimationMode to "rvaniOnFormat" in Object Inspector - that's ok, but what should i do, when i need to create RichView "on the fly"?
Sergey Tkachenko
Site Admin
Posts: 17306
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

For the initial formatting (and for the first formatting after calling Clear) use Format. Use FormatTail only if you added additional lines.
Post Reply