我想画屏幕,怎么能得到屏幕的Canvas?

ShapeRock 2004-10-26 04:40:30
rt
...全文
127 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
S.F. 2004-10-27
  • 打赏
  • 举报
回复
getDC(0);就是桌面了
beyondtkl 2004-10-26
  • 打赏
  • 举报
回复
同意1楼。。

HDC GetDC(
HWND hWnd // handle to a window
);

Parameters
hWnd
Handle to the window whose device context is to be retrieved. If this value is NULL, GetDC retrieves the device context for the entire screen.
todouwang 2004-10-26
  • 打赏
  • 举报
回复
canvas要realease要不就可能有内存泄漏,我刚从书上看的。
rjy206 2004-10-26
  • 打赏
  • 举报
回复
up
fei19790920 2004-10-26
  • 打赏
  • 举报
回复
var
aCanvas:TCanvas;
begin
aCanvas:=TCanvas.Create;

try
aCanvas.Handle:=GetDC(0);
{
//在此你就可以随便画了
aCanvas.lineto(500,500);
}
finally
aCanvas.Free;
end;
end;

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧