hey ranjithtellis
I think you mean width not radius - radius is the distance between the center and the outside edge of a circle. When dealing with rectangles like the map above you use the terms Height and Width. Height is the vertical. Width is the horizontal.
Here is a VB6 function that will display a a message box with the height and width of the map window in pixels and GeoUnits.
As with all my code - globally define
Dim myapp as MapPoint.Application 'and
Dim myobj as MapPoint.Map
Quote:
Public Function getmap_extents() As Integer
Dim wk_istat As Integer
Dim X, Y As Long
wk_istat = 1
If myapp.Units = 0 Then
wk_units = " Miles"
ElseIf myapp.Units = 1 Then
wk_units = " Kilometers"
End If
wk_str = " Map Window Height: " & myobj.Height & vbCrLf
wk_str = wk_str & " Map Window Width: " & myobj.Width & vbCrLf
wk_str = wk_str & " Map Pixel Size: " & myobj.PixelSize & vbCrLf
Y = myobj.Height * myobj.PixelSize
X = myobj.Width * myobj.PixelSize
wk_str = wk_str & " Map Units are:" & wk_units & vbCrLf
wk_str = wk_str & " Height is: " & Y & wk_units & vbCrLf
wk_str = wk_str & " Width is: " & X & wk_units & vbCrLf
wk_rsp = MsgBox(wk_str, vbOKOnly)
getmap_extents = wk_istat
End Function
|
ciao,