本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
bit: TBitmap;
begin
bit := TBitmap.Create;
bit.Width := Width;
bit.Height := Height;
BitBlt(bit.Canvas.Handle, 0, 0, Width, Height, GetWindowDC(Handle), 0, 0, SRCCOPY);
bit.SaveToFile('c:\temp\Form1.bmp');
bit.Free;
end;
end.
相关阅读 >>
Delphi xe 与plc通讯(intcpserver 二进制)
Delphi xe5、6、7在android或者ios上使用ansistring和ansichar
Delphi win32,win64用于单/多线程计数素数的整数性能比较
Delphi sendmessage这个函数有很多奇妙的用途
更多相关阅读请进入《Delphi》频道 >>