tags:

views:

31

answers:

2

I am trying to rotate a monochrome Bitmap in GDI+ using RotateFlip method. When i try to rotate it by 90/270 I get a wrong image or the application crashes. But when I try to rotate it by 180 degrees it works fine. Hence I am now rotating all monochrome bitmaps twice through 180 and then rotating it again by the angle required.

Is this a known bug in GDI+? Any other good workarounds would be appreciated.

+1  A: 
    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);

        Matrix m = new Matrix();
        Bitmap bmp = new Bitmap("myfile");

        m.Rotate(30);
        e.Graphics.Transform = m;
        e.Graphics.DrawImageUnscaled(bmp);
moldovanu