📄 unit1.~pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Mfile: TMetaFile;
MCanvas: TMetaFileCanvas;
R: TRect;
begin
Mfile := TMetaFile.Create;
MCanvas := TMetaFileCanvas.Create(Mfile, 0);
with MCanvas do
begin
Brush.Color := clRed;
Ellipse(0,0,100,100);
R := Rect(Button1.Left, Button1.Top, Button1.Left + 100, Button1.Top + 30);
CopyRect(Rect(0, 0, 100, 50), Canvas, R);
Free;
end;
Form1.Canvas.Draw(0,0,Mfile);
Mfile.SaveToFile('H:\AA.emf');
Mfile.Free;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -