|
-
Apr 24th, 2000, 04:13 AM
#1
Can someone tell me how (in detail) to take a picture box, draw an X line and a Y line in the middle, then whever you move the mouse in the graph, it show the coordinates? Anything will be helpfull.
-
Apr 24th, 2000, 04:37 AM
#2
transcendental analytic
Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Cls
Line (X, 0)-(X, ScaleHeight)
Line (0, Y)-(ScaleWidth, Y)
Caption = X & "," & Y
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 24th, 2000, 05:58 AM
#3
Thanks, but...
Thanks kedaman, thats pretty cool, but its not quite what im looking for. What i was talking about is two lines (X and Y) in the middle, and the intersection is 0. Then where ever you put the mouse, it will send the coordinates back to a label.
-
Apr 24th, 2000, 10:04 AM
#4
Lively Member
I think this may be what you want:
To draw the axes:
Code:
Picture1.Line (Picture1.Width / 2, 0)-(Picture1.Width / 2, Picture1.Height)
Picture1.Line (0, Picture1.Height / 2)-(Picture1.Width, Picture1.Height / 2)
And to track the mouse in the box:
Code:
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = "X:" & X - (Picture1.Width / 2) & " Y:" & (Picture1.Height / 2) - Y
End Sub
-
Apr 24th, 2000, 12:06 PM
#5
Thanks!!!
Thats exactly what i was looking for, thank you so much!!!!!
-
Apr 24th, 2000, 02:14 PM
#6
Ok, what now
Ok i got that part to work, now when i give the graph two points to make a line, it screws up.
-
Apr 24th, 2000, 02:46 PM
#7
transcendental analytic
Sorry, I missunderstood you last time. You really shoud chech out the scaleleft/scaletop/scalewidth/scaleheight properties if you're making graphs, they can be pretty useful. You may integrate scaling zoom and movement and graphs always show correct.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|