|
-
Apr 10th, 2003, 08:48 AM
#1
Thread Starter
Junior Member
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
-
Apr 10th, 2003, 12:12 PM
#2
I wonder how many charact
Not sure exactly what you mean.... but check out this article
http://www.informit.com/isapi/produc...t/articlex.asp
-
Apr 10th, 2003, 02:05 PM
#3
Thread Starter
Junior Member
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
-
Apr 10th, 2003, 02:17 PM
#4
New Member
just recalculate...make a function that switches them..
-
Apr 10th, 2003, 02:22 PM
#5
I wonder how many charact
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.
-
Apr 10th, 2003, 04:53 PM
#6
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!!
-
Apr 15th, 2003, 03:39 AM
#7
Thread Starter
Junior Member
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.
-
Apr 15th, 2003, 03:49 PM
#8
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!!
-
Apr 15th, 2003, 03:55 PM
#9
I wonder how many charact
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.
-
Apr 15th, 2003, 04:42 PM
#10
PowerPoster
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).
-
Apr 16th, 2003, 08:20 AM
#11
I wonder how many charact
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.
-
Apr 16th, 2003, 08:34 AM
#12
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|