Select to view content in your preferred language

How to make PictureMarkerSymbol in code

1948
1
03-20-2014 11:45 PM
AnatoliiTerentiev
Deactivated User
Dear Gurus!

1. There are x,y - table with records of different types of situations. Each record contains the code of the type of situation. Each record in situation type table contains  image to be displayed on the map. How to  generated  on the fly in code  PictureMarkerSymbol.Source?
2. How to generate PictureMarkerSymbol.Source if the image is stored in the application resources, to which I refer in xaml as follows:
<Image Source="/TableManager;component/Images/view_tree_9345.png" 
?
0 Kudos
1 Reply
AnatoliiTerentiev
Deactivated User
            PictureMarkerSymbol pictSymbol = new PictureMarkerSymbol();

            Uri uri = new Uri("/TableManager;component/Images/view_tree_9345.png", UriKind.Relative);
            ImageSource imgSource = new BitmapImage(uri);
            
            pictSymbol.Source = imgSource;
            pictSymbol.Height = 25;
            pictSymbol.Width = 25;
0 Kudos