|
-
July 16th, 2001, 02:29 PM
#1
(0,0) point in center?
I have a PictureBox that I'm using as a drawing surface. The user specifies the coordinates of a line in four text boxes, presses the cmdDraw CommandButton, and the cmdDraw_Click() event uses a line method to draw the line.
So... I don't know if all that background was necessary, but the jist of my problem is that in order for the program to be intuitive for the user, I want the (0,0) point of my PictureBox to be in the center, not the upper-lefthand corner. I have no idea how to go about doing this.
Any and all help appreciated.
The more you know, the more you know you don't know.
The more you know, the more you know you don't know.
-
July 16th, 2001, 02:40 PM
#2
Re: (0,0) point in center?
Okay. 0 is the centre of the picturebox vertically and 0 is the centre of the box horizontally. Why don't you get the user to enter negative values for coordinates nearer the top than the centre and positive values for those values nearer to the bottom than the centre and so on. Now, you know that the centre vertical measurement (cvm) is picture1.height \2. Therefore if the user wants to place a coordinate at -25 then your draw command would take place at cvm - 25.
Does that make sense?
Regards,
-
July 16th, 2001, 03:20 PM
#3
Thank You Andyb!
That made perfect sense. And it worked too, which is a nice bonus.
The more you know, the more you know you don't know.
The more you know, the more you know you don't know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|