rvgif.pas

来自「与Action相结合,可以解决中文件显示乱码」· PAS 代码 · 共 44 行

PAS
44
字号
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.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?