unit3.~pas
来自「电脑上抓取当前屏幕的一个小程序」· ~PAS 代码 · 共 46 行
~PAS
46 行
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit4, ExtCtrls, StdCtrls, jpeg;
type
TForm3 = class(TForm)
Button1: TButton;
Image1: TImage;
PaintBox1: TPaintBox;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var
Bmp : TBitMap;
Begin
Bmp := TBitMap.Create;
Convert(Image1.Picture.Bitmap,Bmp);
//转换图片
PaintBox1.Canvas.Draw(0,0,Bmp);
Bmp.Free;
end;
procedure TForm3.FormShow(Sender: TObject);
begin
// Image1.Picture.LoadFromFile('c:\1.bmp');
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?