您好,登錄后才能下訂單哦!
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);
}
}
免責(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)容。