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
Printable View
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
Not sure exactly what you mean.... but check out this article
http://www.informit.com/isapi/produc...t/articlex.asp
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
just recalculate...make a function that switches them..
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.
could you do it by graphics.translatetransform?
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 thisQuote:
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.
(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
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.
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).
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.
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