www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawXEvents::CustomEntity_getGeomExtents 方法

返回自定义实本,最小外包

IDL
[id(7)]
void CustomEntity_getGeomExtents(IDispatch* pCustomEntity, DOUBLE* dMinX, DOUBLE* dMinY, DOUBLE* dMaxX, DOUBLE* dMaxY, LONG* pOk);
参数 
说明 
IDispatch* pCustomEntity 
IMxDrawCustomEntity对象 
DOUBLE* dMinX 
最小外包左下角X 
DOUBLE* dMinY 
最小外包左下角Y 
DOUBLE* dMaxX 
最小外包右上角X 
DOUBLE* dMaxY 
最小外包右上角Y 
LONG* pOk 
返回值,成功回 1. 

例如: VC COM

                void CTestVc2005Dlg::CustomEntity_getGeomExtentsMxdrawxctrl1(LPDISPATCH pCustomEntity, double* dMinX, double* dMinY, double* dMaxX, double* dMaxY, long* pOk)
                {
                    // TODO: 在此处添加消息处理程序代码
                    *pOk = 1;
                    IMxDrawCustomEntityPtr spDrawData;
                    pCustomEntity->QueryInterface(&spDrawData);

                    CString sGuid = spDrawData->Guid;
                    if(sGuid == MX_CUSTOM_ENTITY_ID)
                    {
                        if(spDrawData->IsHave(_T("ept") )  != VARIANT_TRUE)
                            return;

                        IMxDrawPointPtr stp =  spDrawData->GetPoint(_T("spt"));
                        if(stp == NULL)
                            return;

                        IMxDrawPointPtr ept =  spDrawData->GetPoint(_T("ept"));
                        if(ept == NULL)
                            return;

                        *dMinX = stp->x;
                        *dMinY = stp->y;

                        *dMaxX = ept->x;
                        *dMaxY = ept->y;
                    }
                }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!