CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Mar 2007
    Posts
    274

    [RESOLVED] Rotated image appears somewhat blurry.

    Is there anyway to get around this? Basically I am trying to rotate an arrow that I am using in place of the treeview's plus/minus expander. When I rotate it -45 degrees, the arrow loses its border, or appears blurry.

    Here is my code for rotating the image:

    Code:
            private Image RotateImage(Image myImage, int myAngle)
            {
                Bitmap b = new Bitmap(myImage.Width, myImage.Height);
    
                Graphics g = Graphics.FromImage(b);
    
                g.TranslateTransform((float)b.Width / 2, (float)b.Height / 2);
                g.RotateTransform(myAngle);
                g.TranslateTransform(-(float)b.Width / 2, -(float)b.Height / 2);
                g.DrawImage(myImage,new Point(0,0));
                g.Dispose();
    
                return myBitMap;
            }
    Last edited by Traps; January 24th, 2009 at 05:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured