C#ArcEngine二次开发如何在出图时图例中添加点要素
在项目中需要添加图例,现在的样式是这种
其中绿色和红色线条是通过以下代码添加的线元素
private static IElement AddLineELements(IPoint startP, IPoint endP, IRgbColor rgbColor, double lineWidth, IGraphicsContainer pGC, string type, esriSimpleLineStyle esriLineStyle)
{
IPolyline pPolyLine = new PolylineClass();
IGeometry pGeometry = new PolylineClass();
ILineElement plineElement = new LineElementClass();
IElement pElement;
ISimpleLineSymbol pLineSym = new SimpleLineSymbolClass();
pLineSym.Style = esriLineStyle;
//设置线粗与线的颜色
pLineSym.Width = lineWidth;
pLineSym.Color = (IColor)rgbColor;
try
{
pPolyLine.SpatialReference = pSpatialReference;
pGeometry.SpatialReference = pSpatialReference;
pPolyLine.FromPoint = startP;
pPolyLine.ToPoint = endP;
pGeometry = (IGeometry)pPolyLine;
plineElement.Symbol = pLineSym;
pElement = (IElement)plineElement;
IElementProperties elePro = (IElementProperties)pElement;
elePro.Type = type;
pElement.Geometry = (IGeometry)pPolyLine;
return pElement;
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message); return null;
}
finally
{
pPolyLine = null; pGeometry = null; plineElement = null; pElement = null;
}
}
我想将上面的“船舶”左侧的红色线条切换为一个圆形,可以根据出图效果进行半径和填充颜色的修改,传入的参数为坐标、半径、颜色和原有的IGraphicsContainer pGC,请问类似上面创建线元素的代码,如何创建一个圆形元素?