代码如下:
已经uses gifimage了,我用gifanimator也不行啊!!同样的错误啊!procedure TForm1.Button1Click(Sender: TObject);
var
Stream:TResourceStream;
Gif:TGraphic;
Begin
Stream:=TResourceStream.Create(HINSTANCE,'t1z','GIF');
Try
GIF:=TGraphic.Create;
Try
GIF.LoadfromStream(Stream);
Image1.Picture.Assign(GIF);
Finally
GIF.Free;
end;
Finally
Stream.Free;
end;
end;
已经uses gifimage了,我用gifanimator也不行啊!!同样的错误啊!procedure TForm1.Button1Click(Sender: TObject);
var
Stream:TResourceStream;
Gif:TGraphic;
Begin
Stream:=TResourceStream.Create(HINSTANCE,'t1z','GIF');
Try
GIF:=TGraphic.Create;
Try
GIF.LoadfromStream(Stream);
Image1.Picture.Assign(GIF);
Finally
GIF.Free;
end;
Finally
Stream.Free;
end;
end;
begin
if (Dest is TBitmap) then
Dest.Assign(Bitmap)
else
inherited AssignTo(Dest);
end;
http://www.tolderlund.eu/delphi/下面这段是官方DEMO代码。uses
GIFimage;procedure TFormDemo.ButtonLoadClick(Sender: TObject);
var
Stream : TStream;
GIF : TGIFImage;
begin
// Do not use buffering.
// This is safe since we have complete control over the TImage's canvas
include(GIFImageDefaultDrawOptions, goDirectDraw); // Create a stream to load the GIF resource from
Stream := TResourceStream.Create(hInstance, 'download', 'GIF');
try
GIF := TGIFImage.Create;
try
// Load the GIF from the resource stream
GIF.LoadFromStream(Stream);
// Display the GIF in the TImage
ImageGIF.Picture.Assign(GIF);
finally
GIF.Free;
end;
finally
Stream.Free;
end;
end;procedure TFormDemo.FormClose(Sender: TObject; var Action: TCloseAction);
begin
// Since we are using the goDirectDraw options, we MUST stop the GIF paint
// thread before the form is destroyed.
ImageGIF.Picture.Graphic := nil;
end;