7
Answers

GDI+ application - change system coordinate origin

Pavel

Pavel

7y
2.4k
1
Hello,

In my GDI+ application I create graphics (rectangles, circles and text) on the panel pnl. For graphical object I need to move the origin from top-left to bottom-left corner.
The solution is to apply consequently 2 transforms ScaleTransform and TranslateTransform to the Graphics object.

Graphics dc = pnl.CreateGraphics();
dc.ScaleTransform(1.0f, -1.0f);
dc.TranslateTransform(0.0f, -pnl.Height);

But in this way the text is mirrored !!!

Is there a simple way to resolve a problem?
 
Thanks in advance.

Pavel.
Answers (7)