www.mxdraw.com
|
该类实现了用户自定义绘制图形到视区的功能,用户从该类继承自已的类,实现 Draw虚函数,在Draw函数里向pDC绘制图形,然后调用MxDraw::RegistDynamicDrawObject 函数注册到系统中,调用MxDraw::UnRegistDynamicDrawObject反注册,该功能最好在命令中使用,临时需要动态在屏幕绘制图形.
class CMxDrawDynamicDrawObject;
mxdrawdynamicdrawobject.h
例如:详使用方法可以参考例程: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(AcGePoint3d(pt[X],pt[Y],0.0) ); } MxDraw::UnRegistDynamicDrawObject(&drawPoint); }