www.mxdraw.com
|
根据一个点,在当前控件显示范围内搜缩闭合区域,然后用该闭合区域创建填充对象。
[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); } }