Using X and Y locations to plot points

uberamd

Member
Joined
Jan 22, 2007
Messages
9
Programming Experience
Beginner
Hello everyone, this is my first post here of many I hope.

I am currently a first year college student majoring in Computer Science. I have taken 1 semester of C++ and thought it would be good to learn VB.net at the same time. My VB.net class started a week ago.

But heck, I figured I would jump right in. My goal for the application is to pull X and Y coordinates from a database and plot them on a windows form. The background of the windows form is a map, and I just draw small circles as the points. The database contains as of now about 400 X and Y points.

The way the points in the DB are setup as the origin is 0, 0. The coordinates in the DB will have a minimum X value of -8200 and a maximum X value of 8200 (positive). Same goes for the Y (-8200 to 8200). The map image is 800x800 and the windows form is 800x815 (the 15 on the y accounts for the title bar at the top).

So basically, when a point is in the DB as being 0, 0 it needs to be displayed on the form as 400, 407.5. That being said, I am having a very hard time coming up with a formula to successfully convert the coordinates in the database from their native values to values that can be displayed on the form. So can anyone help me come up with a formula? Other points include: Database X = -8200, Form X = 0 (far left). Database X = 8200, Form X = 800 (far right). Y is the same.

Any help with converting real coords to form coords would be appreciated. Thanks in advance!
 
The ClientSize property of a control gets or sets the height and width of the client area of the control (a form is a control). You can dynamically set the ClientSize of the form to 800X800 then the conversion is simple math.
It's also possible to use a separate control to draw on (a picturebox for example).
 
By Any chance you are able to plot points on the map by means of drag and drop of icons or other images?

Currently i'm also doing same kind of project where user is able to plot or annotate icons or over a map image and require to save information of the annotated icon over the image. Information might be name of the location or so.

Help me if have such type of scenario.

Regards,
 
Back
Top