⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fimage.pas

📁 很好的源代码
💻 PAS
字号:
unit FImage;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls;

type
  TFrmImage = class(TForm)
    Image: TImage;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure Initialize(const Bitmap: TBitmap; const Filename: String);
  end;

implementation

{$R *.dfm}

{ TFrmImage }

procedure TFrmImage.Initialize(const Bitmap: TBitmap; const Filename: String);
begin
  Image.Picture.Bitmap := Bitmap;
  Caption := Format('%s (%d x %d)',
    [ExtractFilename(Filename),Bitmap.Width,Bitmap.Height]);
  ClientWidth := Bitmap.Width;
  ClientHeight := Bitmap.Height;
  ClientWidth := Bitmap.Width;
end;

procedure TFrmImage.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

end.

⌨️ 快捷键说明

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