TRichView, array of TGIFImage and errors on closing the form
Posted: Sun Sep 30, 2012 6:44 pm
Hi!
I use TRichView and TGIFImage for smiles in a chat. Smilies are written in Dynamic arrays. Everything works fine until smilies are not repeated. Otherwise, when you close the form see the error. Help me, please.
Screenshot of the error:
Source: http://kkepit.if.ua/img/Smiles.rar
I use TRichView and TGIFImage for smiles in a chat. Smilies are written in Dynamic arrays. Everything works fine until smilies are not repeated. Otherwise, when you close the form see the error. Help me, please.
Screenshot of the error:
Source: http://kkepit.if.ua/img/Smiles.rar
Code: Select all
var
Form1: TForm1;
GifList: array of TGIFImage;
i: integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
with RichView1 do
begin
for i:=0 to 2 do
AddPictureExTag('Smile', GifList[i], 0, rvvaAbsMiddle, IntToStr(i));
ReFormat;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
for i:=0 to 2 do
begin
SetLength(GifList, i+1);
GifList[i]:=TGIFImage.Create;
try
GifList[i].LoadFromFile(IntToStr(i+1)+'.gif');
except
end;
end;
RichView1.StartAnimation;
end;
initialization
RegisterClass(TGIFImage);
end.