Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphics grid question

Status
Not open for further replies.

Brenton

Technical User
Jul 29, 2002
43
US
How can I set a coordinate system in a picturebox. For example:

0,0,0 would be center of picturebox.

 
>0,0,0 would be center of picturebox

hmmm 3d in a picturebox!

is there any particular reason why you need to use a picturebox.

would it not be easier to use Direct3D.

good luck!

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
come on... get involved!
To get the best response to a question, please check out FAQ222-2244 first
A General Guide To Excel in VB FAQ222-3383
 
Or you can atleast setup a two-axis coordinate system in a picture box using the Scale method (or statement).

Here is how it goes...
Draw a (big enough) picture box on your form and paste the following code in it. It will setup a normal X-Y plane with X=-100, Y=100 on the top-left corner and X=100, Y=-100 on the bottom-right corner.

Move your mouse around the picture box, the coordinates of the underneath point will appear in tooltip.
__
[tt]
Private Sub Form_Load()
Picture1.Scale (-100, 100)-(100, -100)
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.ToolTipText = "(" & Int(X) & ", " & Int(Y) & ")"
End Sub
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top