溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

ArcEngine+C#畫(huà)點(diǎn)、線、面

發(fā)布時(shí)間:2020-06-28 04:48:15 來(lái)源:網(wǎng)絡(luò) 閱讀:4677 作者:劉朝樣 欄目:編程語(yǔ)言

IFeatureClass pFeatCls;//好像不能放函數(shù)體里面,放里出現(xiàn)提示。
IFeature pFeat;

private void JudgeLayerType()
{
IElement pEle;
//在繪制前,清除mainkMapControl中的任何圖形元素
IGraphicsContainer pGra = mainMapControl.Map as IGraphicsContainer;
IActiveView pAcitveView = pGra as IActiveView;
pGra.DeleteAllElements();
//畫(huà)點(diǎn)

if (pFeatCls.ShapeType == esriGeometryType.esriGeometryPoint )
{
IMarkerElement pMakEle = new MarkerElementClass();
pEle = pMakEle as IElement;
IMarkerSymbol pMakSym = new SimpleMarkerSymbolClass();
pMakSym.Color = this.getRGBColor(0, 0, 255);
pMakEle.Symbol = pMakSym;
pEle.Geometry = pFeat.Shape;
pGra.AddElement(pEle, 0);
pAcitveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
//畫(huà)線
else if (pFeatCls.ShapeType == esriGeometryType.esriGeometryPolyline)
{
ILineElement pLineEle = new LineElementClass();
pEle = pLineEle as IElement;
ILineSymbol pLineSym = new SimpleLineSymbolClass();
pLineSym.Color = this.getRGBColor(0, 0, 255);
pLineSym.Width = 2;
pLineEle.Symbol = pLineSym;
pEle.Geometry = pFeat.Shape;
pGra.AddElement(pEle, 0);
pAcitveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
//畫(huà)面
else if (pFeatCls.ShapeType == esriGeometryType.esriGeometryPolygon)
{
IFillShapeElement pFillShapeEle = new PolygonClass() as IFillShapeElement;
pEle = pFillShapeEle as IElement;
IFillSymbol pFillSym = new SimpleFillSymbolClass();
pFillSym.Color = this.getRGBColor(0, 0, 255);
pFillShapeEle.Symbol = pFillSym;
pEle.Geometry = pFeat.Shape;
pGra.AddElement(pEle, 0);
pAcitveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
}
 

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

ce ne
AI