bool GetDrawRectInScreen(CRect& outRect)
{
CView* pView = acedGetAcadDwgView();
if (!pView)
{
return false;
}
pView->GetWindowRect(outRect);
return true;
}
本文介绍了一个使用C++编写的函数,该函数通过CView对象获取窗口在屏幕上的矩形区域。首先尝试获取AcadDwgView类型的视图对象,如果成功,则使用该对象的GetWindowRect方法来获取并返回屏幕上的矩形区域。
bool GetDrawRectInScreen(CRect& outRect)
{
CView* pView = acedGetAcadDwgView();
if (!pView)
{
return false;
}
pView->GetWindowRect(outRect);
return true;
}

被折叠的 条评论
为什么被折叠?