[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;
}
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.
Re: Rotated image appears somewhat blurry.
Thats what I figured. I wanted to avoid drawing my own images. I'm horrible at that.
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.
Re: Rotated image appears somewhat blurry.
Quote:
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.
Re: Rotated image appears somewhat blurry.
Re: Rotated image appears somewhat blurry.
Quote:
Originally Posted by
Belzeski
Thanks, I am installing paint.net as I read your post. :cool:
Wow, paint.net looks a lot like photoshop. :thumb: