delphi 屏幕截屏


本文整理自网络,侵删。

 function GetScreenAll: TBitmap; // 截取全屏
var
  C: TCanvas;
begin
  C := TCanvas.Create;
  result := TBitmap.Create;
  result.Width  := Screen.Width;
  result.Height := Screen.Height;
  C.Handle := GetDC(0);  // 获取屏幕的设备上下文句柄,并拷贝
  result.Canvas.CopyRect(Rect(0, 0, screen.Width, screen.Height), C, Rect(0, 0, Screen.Width, SCreen.Height));
  ReleaseDC(0, C.Handle);
  C.Free;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
var
  B: TBitmap;
begin
  B := TBitmap.Create;
  B := GetScreenAll();
  B.SaveToFile('d:\test2.bmp');
  b.Free;
end;

相关阅读 >>

Delphi xe5中以andorid 启动应用程序

Delphi indy 10.5.7的数据发送接收的用法

重新组织编写Delphi的md2、md4、md5类

wmi技术介绍和应用

Delphi中tlistview控件使用

Delphi 系统对话框(如浏览目录)被隐藏到主窗体后面造成程序无法操作的临时处理方式

Delphi 检测程序有没有被dll注入的代码

Delphi 安卓添加资源图片并读取

Delphi 用hook实现dll注入详解

Delphi firemonkey移动应用程序将设置保存到ini文件的示例

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



打赏

取消

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

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

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

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

评论

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