I’m importing imagery onto my MapSuite map and when a user opens a GeoTIFF/JPG/etc I first show a dialog box with a thumbnail of the image and some basic info about the file before they click OK to overlay it on the map. In my old version of my app with MapSuite 2.0, I had this:
Dim newImageLayer As ImageLayer = New ImageLayer(imageFilename)
frmImageProperties.lblUpperLeft.Text = DecimalDegrees.DecimalDegreesToDMS(TempImageLayer.GetBoundingBox.UpperLeftPoint)
frmImageProperties.lblLowerRight.Text = DecimalDegrees.DecimalDegreesToDMS(newImageLayer.Extent.LowerRightPoint)
frmImageProperties.lblWidth.Text = Format(newImageLayer.Extent.Width(MapLengthUnits.DecimalDegrees, MapLengthUnits.miles), “#.###”) + " miles"
frmImageProperties.lblHeight.Text = Format(newImageLayer.Extent.Height(MapLengthUnits.DecimalDegrees, MapLengthUnits.miles), “#.###”) + " miles"
I’ve converted it to this for MapSuite 4.0:
Dim TempImageLayer As New GdiPlusRasterLayer(imageFilename)
TempImageLayer.Open()
Dim imageRectShape As RectangleShape = TempImageLayer.GetBoundingBox
frmImageProperties.lblUpperLeft.Text = DecimalDegreesHelper.GetDegreesMinutesSecondsStringFromDecimalDegreePoint(imageRectShape.UpperLeftPoint)
frmImageProperties.lblLowerRight.Text = DecimalDegreesHelper.GetDegreesMinutesSecondsStringFromDecimalDegreePoint(imageRectShape.LowerRightPoint)
frmImageProperties.lblWidth.Text = Format(imageRectShape.Width, “#.###”) + " miles"
frmImageProperties.lblHeight.Text = Format(imageRectShape.Height, “#.###”) + " miles"
frmImageProperties.CreateThumb(imageFilename)
TempImageLayer.Close()
That runs, but the width and height are definitely not in miles (Map is in decimal degrees). How do I get or set the units?