delphi 把整个窗体保存为图片的方法


本文整理自网络,侵删。

 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 判断字符串是否相同

winsock 实现telnet后门

Delphi getfilehashmd5获取文件 hashmd5值

Delphi 多桌面切换

Delphi 中的常用事件

Delphi 万年历 程序源码下部分(包括:农历计算、24节气、星期计算、属相)

Delphi 获取ie7 ie8 ie9 地址栏网址

Delphi base64, quoted-printable 的解码与编码函数

Delphi应用synedit完美实现sql语法高亮

Delphi tgifimage:timage显示gif动画

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...