Select to view content in your preferred language

How do I show contents of raster field from SQL in a MapTip

764
3
10-21-2010 08:31 AM
KevinKingrey
Emerging Contributor
I am creating a map where I need to show a photo from a SQL database table when the user hovers over the map feature.  I am able to show the text fields without a problem.  The code section I have looks like this???
....                  
<TextBlock Text="{Binding [Name]}" FontWeight="Bold"/>
<TextBlock Text="{Binding [Address]}" />
<Image Stretch="None" Source="{Binding [Picture]}" />
....
Is there a converter I need to use to interpret the information from SQL for that field?  If so, what is it and how do I implement it?

Thanks!
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
What field type is Picture? Is it a string URL? Image Source property expects a BitmapImage.  So if you are to write your converter, you need to convert string to BitmapImage

BitmapImage bmp = new BitmapImage(new Uri(stringUrl, UriKind.Relative));
0 Kudos
KevinKingrey
Emerging Contributor
Jennifer,

Thanks for the quick reply!

The field type is "Raster", which allows me to load the picture directly into the field during an edit session.  Would the image path be easier to work with in this case?
0 Kudos
Matrix_Solutions_Inc_Geomatics
Regular Contributor
So, If I wanted the contents of a raster field to display in a map tip, would i have to read the contents out, convert it and bind it to an image element ?
0 Kudos