コード例 #1
0
        public static System.Drawing.Drawing2D.Matrix RotateGraphics(
            System.Drawing.Graphics g,
            System.Drawing.Rectangle Bounds,
            float Angle)
        {
            //			System.Drawing.Point cp = RectangleCommon.Center( Bounds );
            //			System.Drawing.Rectangle rect = new System.Drawing.Rectangle (
            //				cp.X - ContentBounds.Width / 2 ,
            //				cp.Y - ContentBounds.Height / 2 ,
            //				ContentBounds.Width ,
            //				ContentBounds.Height );


            System.Drawing.Drawing2D.Matrix om = g.Transform;
            System.Drawing.Drawing2D.Matrix nm = om.Clone();
            System.Drawing.Point            p  = RectangleCommon.Center(Bounds);
            nm.RotateAt(Angle, new System.Drawing.PointF(p.X, p.Y));
            g.Transform = nm;
            return(om);
        }