trichview.com

trichview.support




Re: animated gif


Return to index


Author

Message

shmp

Posted: 06/02/2002 2:57:39


You have to have the gif component like the one

written by Anders Melander or even use the RXLib gif component.

Here is an example for the RXLib.


procedure InsertGifImage;

var

  rxgif : TRxGIFAnimator;

  Align : TRVAlign;

begin

  rxgif := TRxGIFAnimator.Create(nil);

   rxgif.Animate := False;

   rxgif.Image.LoadFromFile('Name of gif file');

   RichView1.AddControlEx('', rxgif, 0, Align);

   {rxgif is a control for the GIF and has to be added as a control.

    It is one of RxLib control. You can add on click event and others}

end;

{---------------------------------------------------------------------------

-----------}

{You must not forget to include the function and initialization}


function MyCreateGraphics(GraphicClass: TGraphicClass): TGraphic;

begin

  if GraphicClass = TGIFImage then  begin

    Result := TGifImage.Create;

    end

  else

    Result := GraphicClass.Create;

end;

{---------------------------------------------------------------------------

---}


initialization

  // We need to register classes in order to load them from rvf files

  TPicture.RegisterFileFormat('gif','Gif Image',TGIFImage);

  RV_CreateGraphics := MyCreateGraphics;

  RV_AfterImportGraphic := MyAfterImportGraphic;

  RegisterClasses([TRxGIFAnimator]);


{Also do not forget to include the unit name in the uses section}

=================================================

>

> Does anybody knows how i can insert animated GIF's in TRichView ?

> Does TRichView can display only the first frame of the animated GIF ?







Powered by ABC Amber Outlook Express Converter