Image is not diplaying in custom marker.

Jun 30, 2010 at 5:31 AM

In WPF Application, am using same Custom Marker showed in Demo of GMap. But adding rather than simple lable i want to add image.

Public Sub New(ByVal window As GMapTruckLocator, ByVal marker As GMapMarker, ByVal title As String)

        Me.MainWindow = window
        Me.Marker = marker

        Popup = New Popup()
        stkPanel = New StackPanel()
        Label = New Label()
        TruckImage = New Image()

        Popup.Placement = PlacementMode.Mouse
        If True Then
            stkPanel.Background = Brushes.LightYellow
            stkPanel.Orientation = Orientation.Vertical

            Label.Background = Brushes.Gold
            Label.HorizontalAlignment = Windows.HorizontalAlignment.Stretch
            Label.Foreground = Brushes.LightYellow
            Label.BorderBrush = Brushes.WhiteSmoke
            Label.BorderThickness = New Thickness(2)
            Label.Padding = New Thickness(5)
            Label.FontSize = 14
            Label.Content = title


            TruckImage.Width = 75
            TruckImage.Height = 75

            Dim bmapImg As New BitmapImage
            'bmapImg.CacheOption = BitmapCacheOption.Default
            bmapImg.UriSource = New Uri("Images/Truck1.jpg", UriKind.Relative)

            TruckImage.Source = bmapImg

        End If
        Popup.Child = stkPanel
End Sub

By this Label which i added in stack panel is coming but image is not displaying. There is nothing wrong with Image Path.

What could be a problem?



Jun 30, 2010 at 5:59 AM
Edited Jun 30, 2010 at 6:00 AM


src.UriSource = new Uri("picture.jpg", UriKind.Relative);
src.CacheOption = BitmapCacheOption.OnLoad;


Jun 30, 2010 at 6:21 AM

Sir not able to understand where this src came?

Let me describe once again. In a map for one location i put a pin with bigMarkerGreen.png now when user mouse hover to this pin i need to show lable as well as image. so i take a stack panel & did as above. now problem is with binding  TruckImage.Source = bmapImg Truck image is not displaying.

I tried all option of CatcheOption

 bmapImg.CacheOption = BitmapCacheOption.OnLoad, Default

but still image is not displaying.



Jun 30, 2010 at 6:35 AM

g ;D bmapImg == src