Select to view content in your preferred language

Draw Symbol as Image

2719
3
Jump to solution
08-17-2014 12:35 AM
Labels (1)
WayneGuidry
Occasional Contributor

Previously in ArcObjects if you wanted to draw a symbol as an image to use as a preview image (i.e. in like a button) you could use this code: preview IMarkerSymbol symbol‌ however the Symbol class in Runtime does not have the SetupDC, Draw, ResetDC calls in it and I don't see any other properties that would allow binding its image to a button in XAML or code-behind. How would I do the same capability with the symbol classes in ArcGIS Runtime?

Thanks

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Deactivated User

In ArcGIS Runtime you can use  SymbolDisplay from Toolkit to show the symbol.

<esriPrimitives:SymbolDisplay Height="25" Width="30" Symbol="{Binding Symbol}" />

View solution in original post

0 Kudos
3 Replies
AnttiKajanus1
Deactivated User

In ArcGIS Runtime you can use  SymbolDisplay from Toolkit to show the symbol.

<esriPrimitives:SymbolDisplay Height="25" Width="30" Symbol="{Binding Symbol}" />

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Good suggestion from Antti - you can see the source for the SymbolDisplay here: arcgis-toolkit-sl-wpf/SymbolDisplay.cs at master · Esri/arcgis-toolkit-sl-wpf · GitHub‌.

Another option might be to use RenderTargetBitmap if you have the XAML or are building up the symbols programmatically - there is an example on Github from a previous Dev Summit: tips-and-tricks-wpf/Best-Development-Practices-and-Patterns/PictureMarkerSymbol-From-Wpf/SourceCode ...

Cheers

Mike

WayneGuidry
Occasional Contributor

Both of these ways will be beneficial now and later. Thanks for the help!

0 Kudos