unit5.pas
来自「生日闹钟源文件」· PAS 代码 · 共 62 行
PAS
62 行
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, jpeg, ExtCtrls;
type
TForm5 = class(TForm)
Image1: TImage;
SaveDialog1: TSaveDialog;
Panel4: TPanel;
Image4: TImage;
SpeedButton5: TSpeedButton;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
uses
unit1;
{$R *.dfm}
procedure TForm5.FormCreate(Sender: TObject);
begin
if fileexists(now1+'delphi.bmp') then
image1.Picture.loadFromFile(now1+'delphi.bmp');
end;
procedure TForm5.SpeedButton5Click(Sender: TObject);
var
bmp:tbitmap;
begin
bmp:=tbitmap.Create;
bmp.Height:=600;
bmp.Width:=800;
bmp.Canvas.CopyRect(rect(0,0,800,600),image1.Canvas,rect(0,0,screen.width,
screen.height-25));
if savedialog1.Execute=true then
bmp.SaveToFile(savedialog1.FileName+'.jpg');
end;
procedure TForm5.Timer1Timer(Sender: TObject);
begin
if fileexists(now1+'delphi.bmp') then
image1.Picture.loadFromFile(now1+'delphi.bmp');
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?