www.mxdraw.com
内容索引主面
前一个向上下一个
CMxDrawDynamicDrawObject 类

该类实现了用户自定义绘制图形到视区的功能,用户从该类继承自已的类,实现 Draw虚函数,在Draw函数里向pDC绘制图形,然后调用MxDraw::RegistDynamicDrawObject 函数注册到系统中,调用MxDraw::UnRegistDynamicDrawObject反注册,该功能最好在命令中使用,临时需要动态在屏幕绘制图形.

C++
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);
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!