Insert gif-image(animated) into TRichViewEdit from stream

General TRichView support forum. Please post your questions here
Post Reply
tors
Posts: 6
Joined: Thu Jan 31, 2008 7:13 am

Insert gif-image(animated) into TRichViewEdit from stream

Post by tors »

How too Insert gif-image(animated) into TRichViewEdit from stream
(TMemoryStream)
It is necessary that gif-image was stored in the document
( Is direct in a rtf-file)
Need that gif-animation play in TRichViewEdit.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If gif image is stored in TMemoryStream, you can load it in the proper graphic class (see http://www.trichview.com/forums/viewtopic.php?t=89) and insert:

Code: Select all

var gif: TGifImage;

gif := TGifImage.Create;
Stream.Position := 0;
gif.LoadFromStream(Stream);
RichViewEdit1.InsertPicture('', gif, rvvaBaseLine);
See the topic referenced above how to turn on animations.

But you cannot store gif images in RTF (Rich Text Format) files. This format supports bitmaps, metafiles, png, jpegs, but not gifs.
You can store gif images in RVF files.
tors
Posts: 6
Joined: Thu Jan 31, 2008 7:13 am

Post by tors »

I am set:

Code: Select all

RichViewEdit.AnimationMode:=rvaniOnFormat;
but gif-animation dont play
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Did you include the proper file in your project?
RVGifAnimate2007 for Delphi 2007, or
RVGifAnimate for Anders' TGifImage, or
RVJvGifAnimate for JVCL Gif Image?
tors
Posts: 6
Joined: Thu Jan 31, 2008 7:13 am

Post by tors »

I am download Anders Melander's TGifImage and
update.
Add unit RVGifAnimate into project
(uses)

Code: Select all

RichViewEdit.AnimationMode:=rvaniOnFormat;

Code: Select all

GifImg4Paste:=GifImage.TGifImage.Create;
GifImg4Paste.LoadFromFile('c:\aa.gif');//load animated gif
GifImg4Paste.Animate:=true;
//GifImg4Paste.AnimationSpeed:=1000;

Code: Select all

RichViewEdit.InsertPicture('',GifImg4Paste,rvvaBaseLine);
animation dont play
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me a simple project to reproduce
Post Reply