Results 1 to 5 of 5

Thread: [RESOLVED] Inverse coordinate system? How?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    290

    Resolved [RESOLVED] Inverse coordinate system? How?

    I'm just using
    Code:
    Picture1.Line (x1, Y1) - (X2, Y2)
    for drawing some lines in the control.

    The problem appears when I got a reverse line. I mean, in the VB6 coordinate system, the 0 value of Y is in the top of the picture1 control. I would like to draw like if the value 0 of the Y, would be in the bottom of the form instead of the top.

    What do I need to modify?
    Last edited by Jose_VB; Jul 18th, 2015 at 03:04 PM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Inverse coordinate system? How?

    Once you change the scale, any Print, Line, drawing commands are in 'user-defined' scale mode.

    Let's say you want the picturebox to range from 0 to 1000 horizontally and 0 to 500 vertically but want the vertical coordinate system to move from bottom to top...

    Picture1.Scale (0, 500) - (1000, 0)
    The parameters are: Scale (x1, y1) - (x2, y2)

    Again, once changed, the units of the picturebox are user-defined. In the above example, each unit is 1/1000th horizontally and 1/500th vertically. So, Picture1.Line (0,0) - (1000,500) will draw a diagonal line from the bottom left corner to the top right corner
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Hyperactive Member Rattled_Cage's Avatar
    Join Date
    Dec 2005
    Posts
    315

    Re: Inverse coordinate system? How?

    take a look at this it lets you move the point of where to start
    and then draw by angles 0-360

    (some one here showed me how cant remember who,,,but thanks again : )

    hope it helps : )
    Attached Files Attached Files

  4. #4
    Lively Member
    Join Date
    Apr 2015
    Posts
    120

    Re: Inverse coordinate system? How?

    Unless I miss something ...

    Picture1.Line (x1, Picture1.Height-Y1) - (X2, Picture1.Height-Y2)

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    290

    Re: Inverse coordinate system? How?

    Quote Originally Posted by JackB View Post
    Unless I miss something ...

    Picture1.Line (x1, Picture1.Height-Y1) - (X2, Picture1.Height-Y2)
    Just one observation.

    It works, but instead of using .Height I used .ScaleHeight

    Thanks anyway.

Tags for this Thread

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