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