expgpresf.pas

来自「Delphi高级开发指南是开发程序的好帮手」· PAS 代码 · 共 51 行

PAS
51
字号
unit ExpGPResF;

interface

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

type
  TResultPForm = class(TForm)
    StringGrid1: TStringGrid;
    Panel1: TPanel;
    procedure SpeedClick (Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TResultPForm.SpeedClick(Sender: TObject);
var
  OpenDlg: TOpenDialog;
begin
  OpenDlg := TOpenDialog.Create (nil);
  try
    OpenDlg.Filter :=
      'Bitmap file (*.bmp)|*.bmp|Any file (*.*)|*.*';
    if OpenDlg.Execute then
      with (Sender as TSpeedButton) do
      begin
        Glyph.LoadFromFile (OpenDlg.Filename);
        if (Glyph.Width mod Glyph.Height) = 0 then
          NumGlyphs := Glyph.Width div Glyph.Height;
      end;
  finally
    OpenDlg.Free;
  end;
end;

procedure TResultPForm.FormCreate(Sender: TObject);
begin
  // dummy code
end;

end.

⌨️ 快捷键说明

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