RVGif.pas
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:1k
- unit RVGif;
- interface
- {.$DEFINE USEGIFIMAGE}
- // Use this define if you want to enable Gif support
- // with Anders Melander's TGifImage
- // http://www.torry.net/vcl/graphics/gif/gifimage.exe (original)
- // http://www.trichview.com/resources/thirdparty/gifimage.zip (update)
- implementation
- {$IFDEF USEGIFIMAGE}
- uses Classes, GifImage, Graphics, RVFuncs;
- procedure MyAfterImportGraphic(Graphic: TGraphic);
- begin
- if Graphic is TGIFImage then
- TGIFImage(Graphic).DrawOptions := TGIFImage(Graphic).DrawOptions-[goAnimate]+[goTransparent];
- end;
- {------------------------------------------------------------------------------}
- // Required for Delphi 2-5/C++Builder 1-5
- // I do not know how to convert this function to C++ code
- function MyCreateGraphics(GraphicClass: TGraphicClass): TGraphic;
- begin
- if GraphicClass=TGIFImage then begin
- Result := TGIFImage.Create;
- end
- else
- Result := GraphicClass.Create;
- end;
- {------------------------------------------------------------------------------}
- initialization
- TPicture.RegisterFileFormat('gif','Gif Image',TGifImage);
- RV_CreateGraphics := MyCreateGraphics;
- RV_AfterImportGraphic := MyAfterImportGraphic;
- RegisterClass(TGifImage);
- {$ENDIF}
- end.