Arcengine点,线,面,文本渲染

1.点

IMarkerElement pMarkerElement = new MarkerElementClass();
pMarkerElement.Symbol.Color = TransColorToAEColor(geoColor);
var pElement = pMarkerElement as IElement;
pElement.Geometry = pubGeometry;
var g = mapcontrol.ActiveView.GraphicsContainer;
g.AddElement(pElement, 0);
mapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

2.线

ISimpleLineSymbol pSimpleLineSymbol = new SimpleLineSymbolClass();
pSimpleLineSymbol.Color = TransColorToAEColor(geoColor);
pSimpleLineSymbol.Width = 2;
var pLineElement = new LineElementClass();
pLineElement.Symbol = pSimpleLineSymbol;
var element = pLineElement as IElement;
IRubberBand pRubberBand;
pRubberBand = new RubberLineClass();
element.Geometry = pubGeometry;
var g = mapcontrol.ActiveView.GraphicsContainer;
g.AddElement(element, 0);
mapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

3.面

在地图上绘制多边形代码如下:

 //简单填充样式和颜色
 ISimpleFillSymbol pFillSymbol = new SimpleFillSymbol();
 pFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;
 pFillSymbol.Color = TransColorToAEColor(Color.LightGray);
 pFillSymbol.Style = esriSimpleFillStyle.esriSFSBackwardDiagonal;
 //设置填充要素
 IFillShapeElement pPolygonEle = new PolygonElementClass();
 pPolygonEle.Symbol = pFillSymbol;
 //确定Geometry属性
 IElement pEle = pPolygonEle as IElement;
 pEle.Geometry = polygon;          
 var g = mapcontrol.ActiveView.GraphicsContainer;
 g.AddElement(pEle, 0);
 mapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

Envelop矩形绘制如下:

ISimpleFillSymbol simpleFillsymbol = new SimpleFillSymbolClass();
IRgbColor color = new RgbColorClass();
color.RGB=0;
simpleFillsymbol.Outline.Color = color;
simpleFillsymbol.Outline.Width = 1;
simpleFillsymbol.Style = esriSimpleFillStyle.esriSFSHollow;
IFillShapeElement rectElemnt = new RectangleElementClass();
rectElemnt.Symbol = simpleFillsymbol;
var element = rectElemnt as IElement;
element.Geometry = env;
g.AddElement(element, 0);

(1)pFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid

(默认填充方式)
Solid fill.
在这里插入图片描述

(2)pFillSymbol.Style = esriSimpleFillStyle.esriSFSNull

Empty fill.
在这里插入图片描述

(3)pFillSymbol.Style = esriSimpleFillStyle.esriSFSHollow

Hollow fill (same as esriSFSNull).
在这里插入图片描述

(4)pFillSymbol.Style = esriSimpleFillStyle.esriSFSHorizontal

Horizontal hatch fill ------.在这里插入图片描述

(5)pFillSymbol.Style = esriSimpleFillStyle.esriSFSVertical

Vertical hatch fill ||||||.
在这里插入图片描述

(6)pFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal

45-degree downward, left-to-right hatch fill \.
在这里插入图片描述

(7)pFillSymbol.Style = esriSimpleFillStyle.esriSFSBackwardDiagonal;

45-degree upward, left-to-right hatch fill //.
在这里插入图片描述

(8)pFillSymbol.Style = esriSimpleFillStyle.esriSFSCross

Horizontal and vertical crosshatch ++++++.
在这里插入图片描述

(9)pFillSymbol.Style = esriSimpleFillStyle.esriSFSDiagonalCross

45-degree crosshatch xxxxxx.
在这里插入图片描述

4.文字

var pTextElement = new TextElementClass();
var pFont = (IFontDisp)new StdFont();
pFont.Bold = true;
pFont.Name = "宋体";
pFont.Size = 10;
var pColor = new RgbColorClass();
pColor.RGB = 0;
var pTextSymbol = new TextSymbolClass();
pTextSymbol.Color = pColor;
pTextSymbol.Font = pFont;
pTextElement.Text = text;
pTextElement.Symbol = pTextSymbol;
var pElement = (IElement)pTextElement;
pElement.Geometry = point;
var g = mapcontrol.ActiveView.GraphicsContainer;
g.AddElement(pElement, 0);
 mapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ShirmyMao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值