ESRI.ArcGIS.ADF.IMS
RasterShieldSymbol Class
Members  Example  See Also 
ESRI.ArcGIS.ADF.IMS.Display.Symbol Namespace : RasterShieldSymbol Class




A LabelSymbol used as a custom shield to identify roads (or other line features) with a given raster image.

Object Model


Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class RasterShieldSymbol 
   Inherits LabelSymbol
Visual Basic (Usage)Copy Code
Dim instance As RasterShieldSymbol
C# 
[SerializableAttribute()]
public class RasterShieldSymbol : LabelSymbol 

Example

This example adds a raster shield symbol with a new label renderer to an existing highways layer. After creating the raster shield symbol and setting its properties, a new label renderer and group renderer are created. The existing line symbol and new label symbol are added to the group renderer, which is assigned as the renderer for the layer.
Visual BasicCopy Code
' Create a new raster shield symbol and set its properties

Dim rasterShield As New RasterShieldSymbol()

rasterShield.Font = New FontInfo("Arial", 14, Drawing.Color.Black, FontStyle.Bold)

rasterShield.Image = "C:\Temp\hywsymbol.gif"

' Url property isn't used by image services--only needed if using Web ADF TOC control

rasterShield.Url = "http://myserver/temp/hwysymbol.gif"

rasterShield.LabelMode = ShieldLabelMode.NumericOnly

rasterShield.Antialiasing = False

rasterShield.ShadowColor = Drawing.Color.Gray

rasterShield.TextCasing = TextCasing.AllUpper

rasterShield.TextPosition = New System.Drawing.Point(25, 10)

rasterShield.Transparency = 30



' Retrieve layer and its current SimpleRenderer

Dim layer As FeatureLayer = mapView.Layers.FindByName("Highways")

Dim rend As SimpleRenderer = layer.Renderer



' Create a new label renderer to contain our new symbol

Dim lblRend As New SimpleLabelRenderer()

lblRend.LabelField = "HWYNAME"

lblRend.Symbol = rasterShield



' Create a group renderer and add the new label renderer and the symbol renderer

Dim groupRend As New GroupRenderer()

groupRend.Renderers.Add(lblRend)

groupRend.Renderers.Add(rend)

layer.Renderer = groupRend

C#Copy Code
// Create a new raster shield symbol and set its properties 

RasterShieldSymbol rasterShield = new RasterShieldSymbol(); 

rasterShield.Font = new FontInfo("Arial", 14, Drawing.Color.Black, FontStyle.Bold); 

rasterShield.Image = "C:\Temp\hywsymbol.gif"; 

// Url property isn't used by image services--only needed if using Web ADF TOC control 

rasterShield.Url = "http://myserver/temp/hwysymbol.gif"; 

rasterShield.LabelMode = ShieldLabelMode.NumericOnly; 

rasterShield.Antialiasing = false; 

rasterShield.ShadowColor = Drawing.Color.Gray; 

rasterShield.TextCasing = TextCasing.AllUpper; 

rasterShield.TextPosition = new System.Drawing.Point(25, 10); 

rasterShield.Transparency = 30; 

  

// Retrieve layer and its current SimpleRenderer 

FeatureLayer layer = mapView.Layers.FindByName("Highways"); 

SimpleRenderer rend = layer.Renderer; 

  

// Create a new label renderer to contain our new symbol 

SimpleLabelRenderer lblRend = new SimpleLabelRenderer(); 

lblRend.LabelField = "HWYNAME"; 

lblRend.Symbol = rasterShield; 

  

// Create a group renderer and add the new label renderer and the symbol renderer 

GroupRenderer groupRend = new GroupRenderer(); 

groupRend.Renderers.Add(lblRend); 

groupRend.Renderers.Add(rend); 

layer.Renderer = groupRend; 

    

Remarks

RasterShieldSymbol allows use of a custom shield or other symbol to be placed behind the labels for line features.

Not valid for use with ArcMap Server image services.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Display.Symbol.Symbol
      ESRI.ArcGIS.ADF.IMS.Display.Symbol.LabelSymbol
         ESRI.ArcGIS.ADF.IMS.Display.Symbol.RasterShieldSymbol

See Also

© 2010 All Rights Reserved.