ArcGIS Engine 中 线加箭头

简介:
void AddArrowElement(IGeometry pGeometry, IActiveView pActiveView)
{
IRgbColor pColor = new RgbColorClass();
pColor.Red = 255;

ICartographicLineSymbol pCartoLineSymbol = new CartographicLineSymbolClass();
pCartoLineSymbol.Cap = esriLineCapStyle.esriLCSRound;

ILineProperties pLineProp = pCartoLineSymbol as ILineProperties;
pLineProp.DecorationOnTop = true;

ILineDecoration pLineDecoration = new LineDecorationClass();
ISimpleLineDecorationElement pSimpleLineDecoElem = new SimpleLineDecorationElementClass();
pSimpleLineDecoElem.AddPosition( 1);
IArrowMarkerSymbol pArrowMarkerSym = new ArrowMarkerSymbolClass();
pArrowMarkerSym.Size = 8;
pArrowMarkerSym.Color = pColor;
pSimpleLineDecoElem.MarkerSymbol = pArrowMarkerSym as IMarkerSymbol;
pLineDecoration.AddElement(pSimpleLineDecoElem as ILineDecorationElement);
pLineProp.LineDecoration = pLineDecoration;

ILineSymbol pLineSymbol = pCartoLineSymbol as ILineSymbol;

pLineSymbol.Color = pColor;
pLineSymbol.Width = 1;

ILineElement pLineElem = new LineElementClass();
pLineElem.Symbol = pLineSymbol;
IElement pElem = pLineElem as IElement;
pElem.Geometry = pGeometry;

IGraphicsContainer pGraphicsContainer = mCtrl.Map as IGraphicsContainer;
pGraphicsContainer.AddElement(pElem, 0);

mCtrl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}



本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/4363224.html,如需转载请自行联系原作者
相关文章
|
10月前
|
SQL 开发框架 数据可视化
ArcGIS Engine学习系列1 AE基础介绍
市面上AE教程大致到ArcGIS10.2,ESRI宣布从ArcGIS10.5开始便停止AE的更新,使用AO做开发,初学者可以在学习C#语言后,从AE入门,逐渐过度到AO。不同版本下AE数据类型数量Enums:枚举类型,用于实现一些定义的内容Structs:结构体Interfaces:接口Classes:类AE开发中,为了更好地管理COM对象,ESRI将这些COM对象放到不同的组件库中。
213 0
|
SQL 数据安全/隐私保护 数据库
ArcGIS Engine 连接SQL Server并建立关联
IWorkspaceFactory  pWFactory=new OLEDBWorkspaceFactory(); IPropertySet  pPropertySet=new  PropertySetClass(); pPropertySet.
824 0