skingraphic.pas

来自「这是VCLSKIN v4.22 的所有的源代码」· PAS 代码 · 共 40 行

PAS
40
字号
unit SkinGraphic;

interface
uses Windows,SysUtils,Classes,Graphics,Jpeg;

type
  TSkinGraphic = Class (TJPEGImage)
  private
  protected
  public
     procedure LoadFromFile(const FileName: string);override;
  end;

implementation

procedure TSkinGraphic.LoadFromFile(const FileName: string);
var s,s1:string;
    temp:Tbitmap;
begin
   s1:= ExtractFileExt(filename);
   s:= FileName;
   s:= StringReplace(s,s1,'.jpg',[rfIgnoreCase]);
   if fileexists(s) then
     inherited loadfromfile(s)
   else begin
     temp:=Tbitmap.create;
     temp.Width:=150;
     temp.height:=25;
     temp.Canvas.TextOut(1,1,'No Preview Image Found');
     assign(temp);
     temp.free;
   end;
end;

initialization
  TPicture.RegisterFileFormat('skn','Skin File', TSkinGraphic);
finalization
  TPicture.UnregisterGraphicClass(TSkinGraphic);
end.

⌨️ 快捷键说明

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