Results 1 to 12 of 12

Thread: Changing picture coordinates

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    22

    Changing picture coordinates

    Hi

    Can I in any way change the fact that origo (0,0) is in the upper left corner of th picture (or Graphics object)

    I need origo to be in the lower left corner

    Thanks in advance
    David N. /Sweden

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Not sure exactly what you mean.... but check out this article

    http://www.informit.com/isapi/produc...t/articlex.asp

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    22
    thanks, but that doesn't really help

    What I need is for the Y-axis to be poitive up, not positive down.

    /\ Y
    |
    |
    |
    |
    |
    0,0------------------>X

    Not

    0,0------------------>X
    |
    |
    |
    |
    |
    \/ Y

  4. #4
    New Member
    Join Date
    Apr 2003
    Posts
    8
    just recalculate...make a function that switches them..

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Sorry, but I think you're stuck with positive down for the y axis, unless you rotate it 180 degrees (but in which case you'll have x axis going the other way too).

    Personally, you need to explain more of what you're trying to accomplish (layman's terms)... because I'm bewildered on why you would need this, since you can use simple calculations to acheive a postive Y affect. If y=900, then do a y-=900 to get y=0.

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    could you do it by graphics.translatetransform?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    22
    ok...

    Thanks for your help. I think I'll just recalculate the y-axis then.

    The reason I need The Y-axis to be positive up is I have some old cordinates that uses that kind of cordinate-sytem.

  8. #8
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Zcumbag
    ok...

    Thanks for your help. I think I'll just recalculate the y-axis then.

    The reason I need The Y-axis to be positive up is I have some old cordinates that uses that kind of cordinate-sytem.
    I think you can do it with translate transform though... Lets say your picturebox size is 200x200 pixels. BEFORE you draw anything with the Grahpics object, do this
    (gr= your graphics object)
    gr.TranslateTransform(100,100)
    this means that everything is shifted 100 pixels down, and 100 pixels to the right. Which means 0,0 would be at the center of the picturebox.
    HTH
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    It doesn't solve his problem of transforming one axis to go opposite of the other.... if he could get away with both axis going the same direction, he could simply rotate it... but he needs the yaxis going the opposite direction with the xaxis remaining the default direction.

  10. #10
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Then couldn't he do something like this:
    gr.TranslateTransform(0,200)

    To keep the x axis at zero, and move the y axis down 200 (assuming the picture is 200 high).

  11. #11
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    In that case, if he wanted to say draw a line from the top-left to bottom-right (0,0) - (0,200) , it would end up being (after the transform) (0,200) - (0,400)....

    He wants this:

    /\ Y
    |
    |
    |
    |
    |
    0,0------------------>X

    Not

    200,0------------------>X
    |
    |
    |
    |
    |
    \/ Y

    There may be some function to do it, but I haven't seen it. It could be it just was not a feature that was implemented, since all it does is recalculate the Y-value, if you feed 200, it would translate it to -200.

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    22
    since I am a (former ) C++ programmer i seem to recall some function called SetMappingMode that does what I'm after.

    I think there's a function in GDI+ called SetMapMode() but I have'nt gotten it to work

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