After copy/paste gif animations don't play
After copy/paste gif animations don't play
Give the advice.
How start play animation when item copy and paste to same richviewedit control ?
TRichview v10.1
How start play animation when item copy and paste to same richviewedit control ?
TRichview v10.1
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
See here: http://www.trichview.com/forums/viewtopic.php?t=89 (the 2nd and 3rd posts)
Sorry, but you don't understand. The animation work normaly if i use InsertPicture method.
But if i select some gif image (from already added and play annimation normaly) and copy/paste it in same TRichViewEdit control. I will have only still frame with new pasted images. (with some pallete bug, black color will be transparent)
I use this gif companent: http://www.trichview.com/resources/thir ... fimage.zip (update - required)
But if i select some gif image (from already added and play annimation normaly) and copy/paste it in same TRichViewEdit control. I will have only still frame with new pasted images. (with some pallete bug, black color will be transparent)
I use this gif companent: http://www.trichview.com/resources/thir ... fimage.zip (update - required)
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I sent source example with binary exe to <[email protected]>
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This problem happens because you have two TGifImage classes - from RxGif.pas and from GifImage.pas.
When you insert TGifImage, you insert GifImage.TGifImage, because GifImage is included in "uses" of your unit. But when pasting, RxGif.TGifImage is inserted (because it is registered with RegisterClasses procedure). Animation of this class is not supported by TRichView.
Solutions:
1) Add RxGif in "uses" (before GifImage, otherwise TGifImage will be treated as RxGif.TGifImage, not as GifImage.TGifImage) and call in FormCreate:
or, better
2) Do not use Gif image from RX. Why do you need duplicate classes? GifImage.TGifImage can play animations directly in TImage (or you can use TRichView with one image instead of TImage)
When you insert TGifImage, you insert GifImage.TGifImage, because GifImage is included in "uses" of your unit. But when pasting, RxGif.TGifImage is inserted (because it is registered with RegisterClasses procedure). Animation of this class is not supported by TRichView.
Solutions:
1) Add RxGif in "uses" (before GifImage, otherwise TGifImage will be treated as RxGif.TGifImage, not as GifImage.TGifImage) and call in FormCreate:
Code: Select all
UnRegisterClass(RXGif.TGIFImage);
RegisterClass(GifImage.TGifImage);
2) Do not use Gif image from RX. Why do you need duplicate classes? GifImage.TGifImage can play animations directly in TImage (or you can use TRichView with one image instead of TImage)
Thank you. I try to remove RX gif. But when i do it copy/paste do nothing after copy gif nothing wants to paste.Sergey Tkachenko wrote: or, better
2) Do not use Gif image from RX. Why do you need duplicate classes? GifImage.TGifImage can play animations directly in TImage (or you can use TRichView with one image instead of TImage)
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CRVData, CRVFData, RVScroll, RichView, RVEdit, GifImage, RVGifAnimate,
RVStyle, Animate;
type
TForm1 = class(TForm)
RVStyle1: TRVStyle;
Button1: TButton;
SendRVEdit: TRichViewEdit;
Label1: TLabel;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
smgif: TGifImage;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
smgif := TGifImage.Create;
smgif.LoadFromFile(ExtractFileDir(ParamStr(0))+'\bc.gif');
end;
procedure TForm1.Button1Click(Sender: TObject);
var gif: TGifImage;
Begin
gif:=TGifImage.Create;
gif.Assign(smgif);
SendRVEdit.InsertPicture('',gif,rvvaBaseLine);
end;
end.
rvoAutoCopyImage=True
What i miss or do wrong ?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: