Replace a PictureMarkerSymbol with an ImageBrush to enhance graphic display performance


The ArcGIS API for Microsoft Silverlight/WPF includes a PictureMarkerSymbol type to render graphic points using an image icon. Like other symbols in the API, its content is defined by a control template.

The PictureMarkerSymbol control template is provided below:


<ControlTemplate xmlns=""
<Image Source="{Binding Symbol.Source}"
Opacity="{Binding Symbol.Opacity}"
Width="{Binding Symbol.Width}"
Height="{Binding Symbol.Height}" />

When assigned to a graphic (e.g., Graphic.Symbol), an Image control instance is created. If the same picture marker symbol is assigned to 500 graphic points, the image is decoded 500 times. As a result, initial graphic rendering will be relatively slow. Even though the symbol is bound to one image source and thus shared between the 500 graphics (downloaded only once), the decoded image is not shared.

To reduce the overhead associated the PictureMarkerSymbol's use of the Image control, create a custom control template for a symbol and use an ImageBrush.

Instructions provided describe how to replace a PictureMarkerSymbol with an ImageBrush to enhance graphic display performance.


Start with a container (e.g., Rectangle) that has a Fill property that can be set to any type of brush. Use an ImageBrush to reference the desired picture (image) to use to symbolize the graphics. The ImageBrush is responsible for decoding the image, therefore it can be shared among all graphic features that use it. So, when a custom symbol is assigned to 500 graphic points, 500 rectangle instances are created (as defined by the template), but only one image brush is generated. Here is the basic control template for the symbol:


<Rectangle Fill="{Binding Symbol.Fill}"
Opacity="{Binding Symbol.Opacity}"
Width="{Binding Symbol.Width}"
Height="{Binding Symbol.Height}" />

Start by using the MarkerSymbol class included with the ArcGIS API for Microsoft Silverlight/WPF, or create a new custom symbol from scratch. In both cases, the custom marker symbol class should have a public Fill property, which can be used to bind to a brush. Here is an example that shows how to define a custom control template for the MarkerSymbol class:


<ImageBrush ImageSource="/images/i_pushpin.png" x:Name="MyImageBrush" />
<esriSymbols:MarkerSymbol x:Name="MyPictureMarker" OffsetX="10" OffsetY="10">
<Rectangle Fill="{StaticResource MyImageBrush}"
Opacity="0.75" Width="20" Height="20" />

Article ID:000010715

  • ArcGIS API for Silverlight Prev

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic