本文整理自网络,侵删。
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 thttpclient 时获取跳转后的 url
Delphi�⒆执�传入到windows目前窗口cursor所在位置
Delphi tfdquery提交tfdmemtable修改的数据
Delphi twebbrowser出现 method pastehtml not supported by automation object 解决方法
更多相关阅读请进入《Delphi》频道 >>