Results 1 to 4 of 4

Thread: [RESOLVED] graphic draw line

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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)

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: graphic draw line

    It work,

    Why you use Picture1.ScaleHeight? I cannot imagine. And why substract from Y, not from X ?

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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
  •  



Click Here to Expand Forum to Full Width