delphi抓屏代码


本文整理自网络,侵删。

 delphi抓屏代码

procedure TForm1.Button1Click(Sender: TObject);
var winHWND, hCur:integer;
winDC:integer;
rect:TRect;
//AFormat : Word;
//AData,APalette : THandle;
pt:TPoint;
fBitmap:TBitmap;
timer11:Integer;
begin
timer11:=GetTickCount;
hCur := GetCursor(); // 获 得 光 标 句 柄
GetCursorPos(pt); // 记 录 光 标 位 置
winHWND := GetDesktopWindow();
winDC := GetDC(winHWND);
GetWindowRect(winHWND, rect);
fBitmap := TBitmap.create;
fBitmap.width := rect.right-rect.left;
fBitmap.height := rect.bottom-rect.top;
BitBlt(fBitmap.canvas.handle, 0, 0, fBitmap.width, fBitmap.height, winDC, 0, 0, SRCCOPY);
DrawIcon(fBitmap.canvas.handle, pt.x, pt.y, hCur); // 画 光 标
ReleaseDC(winHWND, winDC);
Image1.Picture.Bitmap:= fBitmap;
fBitmap.Free;
Caption:=inttostr( GetTickCount-timer11);
end;

相关阅读 >>

Delphi实现qq右下角弹出信息窗口

Delphi 简单判断图片类型

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

Delphi 测试字符串写入类: tstringwriter

Delphi利用线程注入技术实现刷新流量

Delphi xe5 android 使用system.zip单元释放资源文件

Delphi 如何把类中的方法做参数

Delphi 读取image组件转换base64编码

Delphi 文件大小 显示k kb mb gb tb

Delphi hexstrtobytes

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



打赏

取消

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

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

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

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

评论

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