I may have found a temporary solution to get the animation to work. What i have done so far is used the component GifImage and have placed a procedure called
procedure OnGifPaint(Sender: TObject);
then call TGifImage(Image1.Picture.Graphic).OnPaint := OnGifPaint
and then WPTextObj := WPRichText1.TextObjects.InsertCopy(Image1.Picture.Graphic);
in the OnGifPaint procedure just call
WPTextObj.LoadObjFromGraphic(Image1.Picture.Graphic);
so it would look something like this...
public
{ Public declarations }
procedure OnGifPaint(Sender: TObject);
end;
var
Form1: TForm1;
WPTextObj: TWPTextObj;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
with TOpenDialog.Create(Nil) do
try
If Execute then
Image1.Picture.LoadFromFile(FileName);
TGifImage(Image1.Picture.Graphic).OnPaint := OnGifPaint
finally
free;
end;
WPTextObj := WPRichText1.TextObjects.InsertCopy(Image1.Picture.Graphic);
end;
procedure TForm1.OnGifPaint(Sender: TObject);
begin
WPTextObj.LoadObjFromGraphic(Image1.Picture.Graphic);
end;
although this is messy and you would have to create a list or arrays to maintain each object its the best solution i have come up with so far