|
-
January 24th, 2009, 05:09 PM
#1
[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.
-
January 24th, 2009, 06:03 PM
#2
Re: Rotated image appears somewhat blurry.
That is going to happen when you rotate an image like that. Think about it; that image has to be created programmatically. That data does not exist, so some algorithm is used to try and find the best interpretation. There is a lot of anti-aliasing going on which makes it appear blurry. If you rotate it 90 degrees I am sure it looks fine. Not much you can do about it. If you open that image in a professional image editor the same thing will happen. Just avoid rotating it.
-
January 24th, 2009, 07:10 PM
#3
Re: Rotated image appears somewhat blurry.
Thats what I figured. I wanted to avoid drawing my own images. I'm horrible at that.
-
January 24th, 2009, 08:21 PM
#4
Re: Rotated image appears somewhat blurry.
You could try using an editor like photoshop, GIMP, or Paint.net to do the rotation first. Maybe you'll get a better result. You would have to use two images instead of one.
-
January 24th, 2009, 08:34 PM
#5
Re: Rotated image appears somewhat blurry.
 Originally Posted by BigEd781
You could try using an editor like photoshop, GIMP, or Paint.net to do the rotation first. Maybe you'll get a better result. You would have to use two images instead of one.
Yeah, I dont have photoshop, never heard of GIMP or Paint.net. I'm playing around with IcoFX right now, seems pretty decent for a free editor, except it only saves as .ico files. I wanna make .png's
I'm a complete noob when it comes to drawing/painting/graphics, so i'm just kinda stumbling along.
-
January 24th, 2009, 08:48 PM
#6
Re: Rotated image appears somewhat blurry.
-
January 24th, 2009, 08:51 PM
#7
Re: Rotated image appears somewhat blurry.
Last edited by Traps; January 24th, 2009 at 08:54 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|