注册一个动态显示对象
static void RegistDynamicDrawObject(CMxDrawDynamicDrawObject* pDrawObj, BOOL isAutoUpDisplay = TRUE);
参数 |
说明 |
CMxDrawDynamicDrawObject* pDrawObj |
动态绘制对象指针 |
BOOL isAutoUpDisplay = TRUE |
是否自动调用更新显示函数MxDraw::UpdateDisplay更新图面显示。 |
自定义方式在控件绘图区域绘制图形,注册自定义绘制对象到系统中,在程序退出时或不需要动态绘制时调用MxDraw:: UnRegistDynamicDrawObject反注册。详使用方法可以参考例程:sampleEdit的“动态标记出某点”按钮 例如:
void CTestCommands::TestDynDrawPoint() { CTestDlg* pDlg = (CTestDlg*)(AfxGetApp()->GetMainWnd()); CDynamicDrawPoint drawPoint(pDlg->m_hDrawOcx); MxDraw::RegistDynamicDrawObject(&drawPoint); while(true) { ads_point pt; if(acedGetPoint(NULL,_T("n 点取标记显示的点:"),pt) != RTNORM) { break; } drawPoint.SetDrawPoint(McGePoint3d(pt[X],pt[Y],0.0) ); } MxDraw::UnRegistDynamicDrawObject(&drawPoint); }