System.Drawing.TextureBrush.RotateTransform C# (CSharp) Method

RotateTransform() public method

public RotateTransform ( float angle ) : void
angle float
return void
        public void RotateTransform(float angle)
        {
            this.RotateTransform(angle, MatrixOrder.Prepend);
        }

Same methods

TextureBrush::RotateTransform ( float angle, MatrixOrder order ) : void

Usage Example

Esempio n. 1
0
        public static Bitmap Rotate1(Bitmap bmp, float angle)
        {
            TextureBrush MyBrush = new TextureBrush(bmp);
            double h = Math.Sin(angle) * (bmp.Height / 2) + Math.Sin(90 - angle) * (bmp.Height / 2);
            MyBrush.RotateTransform(angle);

            Bitmap dst = new Bitmap((int)(h * 2), (int)(h * 2));
            Graphics g = Graphics.FromImage(dst);
            //g.DrawImageUnscaled(MyBrush.Image, 0, 0, bmp.Width, bmp.Height);
            //g.FillRectangle(MyBrush,0, 0, (int)(h * 2), (int)(h*2));
            g.SmoothingMode = SmoothingMode.HighQuality;
            g.TranslateTransform(0,0);
            g.RotateTransform(angle);

            g.DrawImage(bmp, 0, 0);
            g.Dispose();

            return dst;
        }
All Usage Examples Of System.Drawing.TextureBrush::RotateTransform