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

根据一个点,在当前控件显示范围内搜缩闭合区域,然后用该闭合区域创建填充对象。

IDL
[id(190), helpstring("method DrawHatchFromPoint")]
LONGLONG DrawHatchFromPoint(DOUBLE dX, DOUBLE dY, DOUBLE dPatternScale);
参数 
说明 
DOUBLE dX 
开始搜索点X值 
DOUBLE dY 
开始搜索点Y值 
DOUBLE dPatternScale 
图案缩放比例 

成功返回创建的Hatch对象

例如: 根据鼠标取一点,计算该点所在区域

                if (e.iCommandId == 1)
                {
                    MxDrawUiPrPoint getPoint = new MxDrawUiPrPoint();
                    getPoint.message = "点取一个点";

                    if (getPoint.go() != MCAD_McUiPrStatus.mcOk)
                        return;

                    MxDrawPoint pt = getPoint.value();
                    Int64  id = axMxDrawX1.DrawHatchFromPoint(pt.x, pt.y, 1);

                    if (id == 0)
                        return;

                    MxDrawHatch hatch = (MxDrawHatch)axMxDrawX1.ObjectIdToObject(id);

                    MxDrawResbuf  pls = hatch.GetPolylines();

                    if (pls.Count != 0)
                    {

                        MxDrawPolyline pl = (MxDrawPolyline)pls.AtObject(0);

                        for (int i = 0; i < pl.NumVerts; i++)
                        {
                            MxDrawPoint tmp =  pl.GetPointAt(i);

                            MessageBox.Show(tmp.x.ToString());
                            MessageBox.Show(tmp.y.ToString());

                        }
                    }

                    axMxDrawX1.Erase(id);

                }
            }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!