I am drawing a graph on a control, but 0,0 is at the top-left hand corner of the control. Is there a way to flip the coordinates so that 0,0 is at the lower left corner of the control?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using WinForms, then you might find that you can flip the Y-Axis using Graphics.ScaleTransform:
You only need to include the begin/end container calls if you want to do additional drawing using the regular coordinate system as well. More information on graphics containers is available on MSDN.
As mentioned by Tom in the comments, this approach requires the
Heightvalue to be available with a correct value. If you try this and see nothing being drawn, ensure that value is correct in a debugger.