Rotating a Graphic

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have a Graphics object that I have drawn several things on using transform
methods (such as RotateTransform and TranslateTransform) and drawing methods
(such as FillRectangle and DrawString) of the Graphics object. It now looks
exactly how I want, except for one thing. I want to rotate the entire thing
by 180 degrees. How can I do this? I think there is something with the
SetClip method or something, but since I don't have a ton of experience with
the Graphics class, I may need some help. Thanks.
 
Nathan Sokalski said:
I have a Graphics object that I have drawn several things on using transform
methods (such as RotateTransform and TranslateTransform) and drawing methods
(such as FillRectangle and DrawString) of the Graphics object. It now looks
exactly how I want, except for one thing. I want to rotate the entire thing
by 180 degrees. How can I do this? I think there is something with the
SetClip method or something, but since I don't have a ton of experience with
the Graphics class, I may need some help. Thanks.

Hi Nathan,

You can add a Rotate and Translate at the top of the graphics manipulation

e.Graphics.RotateTransform(180);
e.Graphics.TranslateTransform(ClientRectangle.Width, ClientRectangle.Height,
MatrixOrder.Append);

Any drawing from here on will be upside down
 
Back
Top