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!
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!