-
Mar 2nd, 2012, 02:12 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] graphic draw line
I want to draw line in picture box, When I compare with the autocad, the line much difference of what it draw in Autocad. Why? I thnik, it problem with The coordinate system in the picture box, How to change the coordinate system of picture box so that the its origin 0,0 stat at lower-left corner
Code:
Picture1.Line (Text1.Text, Text2.Text)-(Text3.Text, Text4.Text), vbBlue
Picture1.FillStyle = 0
Picture1.FillColor = vbRed
Picture1.Circle (Text1.Text, Text2.Text), 100
Picture1.FillStyle = 0
Picture1.FillColor = vbRed
Picture1.Circle (Text3.Text, Text4.Text), 100
Last edited by matrik02; Mar 2nd, 2012 at 02:39 AM.
-
Mar 2nd, 2012, 03:09 AM
#2
Re: graphic draw line
Just subtract your 'Y' values from Picture1.ScaleHeight
Code:
Picture1.Line(Text1.Text, Picture1.ScaleHeight - Text2.Text) - (Text3.Text, Picture1.ScaleHeight - Text4.Text)
-
Mar 2nd, 2012, 03:46 AM
#3
Thread Starter
Frenzied Member
Re: graphic draw line
It work,
Why you use Picture1.ScaleHeight? I cannot imagine. And why substract from Y, not from X ?
-
Mar 2nd, 2012, 03:50 AM
#4
Re: graphic draw line
Because X = 0 is the left hand side of the PictureBox and Picture1.Scalewidth is the bottom of the PictureBox.
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
|