I have two applications and am using the following method in both
Dim IconPath As String = Get_GIS_Icon(Unit_Name)
If System.IO.File.Exists(IconPath) = False Then
IconPath = AppPath & "\icons\gis\base.png"
End If
gisMap.Overlays("iconOverlay").Lock.EnterWriteLock()
Dim myFeature As New Feature(Lon, Lat, Unit_Name)
Try
Dim myMapShape As New MapShape(myFeature)
myMapShape.ZoomLevels.ZoomLevel01.DefaultTextStyle.TextColumnName = "Unit_Name"
myMapShape.ZoomLevels.ZoomLevel01.DefaultPointStyle = New PointStyle(New GeoImage(IconPath))
myMapShape.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim Y As Integer = myMapShape.ZoomLevels.ZoomLevel01.DefaultPointStyle.Image.GetHeight()
NOTE - Y is to get the offset for the label attached to the mapshape
****************
The first works fine with
Dim Y As Integer = myMapShape.ZoomLevels.ZoomLevel01.DefaultPointStyle.Image.GetHeight()
the second fails at that point and I have to do
Dim myImage As New Bitmap(IconPath)
Dim Y As Integer = myImage.Height
I have compared the propeties of myMapShape in both and they look the same
Any ideas
Ewan