Delphi 截图程序方法


本文整理自网络,侵删。

 Delphi 截图程序方法

最近在做Delphi 屏幕截图,这个我试过了,可以的,有需要的可以试试……

function CaptureScreenRect(ARect:TRect):TBitmap;
var ScreenDC:HDC; //设备描述表的句柄
begin
result:=TBitmap.Create ;
with Result,ARect do
begin
Width :=Right-left;
Height:=Bottom-Top;
ScreenDC:=GetDC(0); //获取一个窗口的设备描述表的句柄,0参数返回屏幕窗口设备描述表的句柄
try
//BOOL BitBlt(hdcDest,nXDest,nYDest,nWidth,nHeight,hdcSrc,nXSrc,nYSrc,dwRop)
//把位图从源设备描述表hdcSrc复制到目标设备描述表hdcDest,
//光栅操作码dwRop指定了 源图的组合方式
BitBlt(Canvas.Handle ,0,0,Width,Height,ScreenDC,left,top,SRCCOPY);
finally
ReleaseDC(0,ScreenDC);
end;
end;
end;

相关阅读 >>

Delphi将dbgrid数据导出到excel表中

Delphi thttpclient 时获取跳转后的 url

Delphi idhttp友好错误信息的捕获

rightstr 返回字符串右边指定个数的新字符(串)

Delphi获取千千静听歌词下载地址源码

Delphi�⒆执�传入到windows目前窗口cursor所在位置

Delphi tfdquery提交tfdmemtable修改的数据

Delphi twebbrowser出现 method pastehtml not supported by automation object 解决方法

Delphi dbnavigator1 模拟点击

Delphi的控制台程式添加公司信息、版权信息

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



打赏

取消

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

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

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

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

评论

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