Pavel

Pavel

  • NA
  • 104
  • 37.2k

GDI+ application - change system coordinate origin

Sep 13 2012 10:39 AM
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)