IFeatureClass pFeatCls;//好像不能放函数体里面,放里出现提示。
IFeature pFeat;
private void JudgeLayerType()
{
IElement pEle;
//在绘制前,清除mainkMapControl中的任何图形元素
IGraphicsContainer pGra = mainMapControl.Map as IGraphicsContainer;
IActiveView pAcitveView = pGra as IActiveView;
pGra.DeleteAllElements();
//画点
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);
}
//画线
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);
}
//画面
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);
}
}
ArcEngine+C#画点、线、面
原创
©著作权归作者所有:来自51CTO博客作者刘朝样的原创作品,如需转载,请与作者联系,否则将追究法律责任
上一篇:MapControl
下一篇:AO中的data
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
ArcEngine符号化——点符号
1、前言在GIS系统的开发过程中,地图符号化其实是非常重要的一块内容。play;using stdole
ArcEngine Red Click System -
ArcEngine符号化——点密度符号
1、前言这篇博客主要介绍一下点密度填充。准备一份面要素数据,其属性表
ArcEngine 字段 System Red -
ArcEngine利用点打断线的算法思路
最近一个师妹在做城市可达性分析的相关研究,在对原始数据处理的时候需要利用点打断线。本人第一时间想到
ArcEngine 打断线 System 分割线 Desktop -
ArcEngine符号化——点符号选择器
1、前言前面的博客介绍了在ArcEngine中如何创建各类符号
ArcEngine System 选择器 Click -
ArcEngine简介
ArcEngine简介
ArcEngine简介