Hello, i am trying to plot X,Y coordinate of a location on a map used in a pictureBox in a windows form using vb.net 2008. when i use the complete UTM grid and load it in the Picturebox, the coordinate plots correctly, but when i use a portion of the map, say Indian Map, the Coordinate point is not plotted correctly. the x,y coordinates of (0,0) is the centre of the picturebox.
for example if i plot (New Delhi, India) in the complete grid, it plots correctly, but when i use a portion of the map, and plot 28.66 , 77.22 it plots somewhere else.. how do i proceed further to plot on sized maps i need help with the problem?
Sub mapcoords(ByVal latitude As Double, ByVal longitude As Double)
Dim pbwidth As Double = PictureBox1.Width
Dim pbheight As Double = PictureBox1.Height
Dim latratio As Double = pbheight / 180
Dim longratio As Double = pbwidth / 360
Dim latcord As Double = 90 - latitude
Dim longcord As Double = (180 + longitude)
Dim Pen1 As New Pen(Color.Red, 3)
Dim Pen11 As New Pen(Color.Red, 3)
Dim g As Graphics = PictureBox1.CreateGraphics
latcord = latratio * latcord
longcord = longratio * longcord
g.DrawEllipse(Pen1, CInt(longcord) - 1, CInt(latcord) - 1, 3, 3)
End Sub
on button click, the following code runs
Dim coords() As String = TextBox1.Text.Split(",")
mapcoords(coords(0), coords(1))