Rotating a Graphic

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    Rotating a Graphic

    I have a Graphics object that I have drawn several things on using transform
    methods (such as RotateTransform and TranslateTransf orm) 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
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?=

    #2
    RE: Rotating a Graphic


    "Nathan Sokalski" wrote:
    I have a Graphics object that I have drawn several things on using transform
    methods (such as RotateTransform and TranslateTransf orm) 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
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

    >
    Hi Nathan,

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

    e.Graphics.Rota teTransform(180 );
    e.Graphics.Tran slateTransform( ClientRectangle .Width, ClientRectangle .Height,
    MatrixOrder.App end);

    Any drawing from here on will be upside down

    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    Working...