Page 1 of 1

GIF image doesnot animate

Posted: Fri Sep 25, 2009 3:21 am
by rescuer
Dear sirs,
I use C++ builder 6.0, and TGIFImage version 2.2, and i put gif image direct into form, the gif is animated, but when I insert into RichviewEdit(RichView), the gif image is not animated, but when I click on the RichviewEdit(RichView), the gif image can changes to next frame. following is my code:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TGIFImage *gif = new TGIFImage();

gif->LoadFromFile("animate.gif");
gif->Animate=true;
//gif->AnimationSpeed=1000;
rve->AnimationMode = rvaniOnFormat;

rve->InsertPicture("gif", gif, rvvaBaseline);

rve->StartAnimation();
rve->FormatTail();
}

what's wrong with me?
Thanks in advance!

Posted: Sat Sep 26, 2009 11:31 am
by Sergey Tkachenko
Please read the instructions here:
http://www.trichview.com/forums/viewtopic.php?t=89
Briefly
1) Add RVGifAnimate.pas in your project
2) Assign rve->AnimationMode = rvaniOnFormat.
As far as I remember, FormatTail() does not initiate animation (unlike Format()), so you need either to call Format() one time before starting adding content with FormatTail(), or to call StartAnimation(), like you do.

TRichView does not use animation features of TGIFImage, it animates them itself, so all assignments to animation-related properties or variables of TGIFImage are useless.

Problem solved

Posted: Wed Sep 30, 2009 8:41 am
by rescuer
Thanks Sergey Tkachenko,
I Add RVGifAnimate.pas in my project, the gif image animated.
thank you very much!!!