许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  ArcEngine点、线、面、文本渲染:符号化实现

ArcEngine点、线、面、文本渲染:符号化实现

阅读数 15
点赞 0
article_banner

Arcengine点,线,面,文本渲染

  • 1.点
  • 2.线
  • 3.面
  • (1)pFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid (2)pFillSymbol.Style = esriSimpleFillStyle.esriSFSNull (3)pFillSymbol.Style = esriSimpleFillStyle.esriSFSHollow (4)pFillSymbol.Style = esriSimpleFillStyle.esriSFSHorizontal (5)pFillSymbol.Style = esriSimpleFillStyle.esriSFSVertical (6)pFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal (7)pFillSymbol.Style = esriSimpleFillStyle.esriSFSBackwardDiagonal; (8)pFillSymbol.Style = esriSimpleFillStyle.esriSFSCross (9)pFillSymbol.Style = esriSimpleFillStyle.esriSFSDiagonalCross
  • 4.文字


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);

免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删


相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空