사용자 지정 메서드를 사용하여 그림 상자를 회전하고 있습니다. 이 코드입니다 :사용자 지정 메서드를 회전하는 동안 이미지가 흐려짐
public static Image RotateImage(Image img, float rotationAngle)
{
Bitmap bmp = new Bitmap(img.Width, img.Height);
Graphics gfx = Graphics.FromImage(bmp);
gfx.TranslateTransform((float)bmp.Width/2, (float)bmp.Height/2);
gfx.RotateTransform(rotationAngle);
gfx.TranslateTransform(-(float)bmp.Width/2, -(float)bmp.Height/2);
gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;
gfx.DrawImage(img, new Point(0, 0));
gfx.Dispose();
return bmp;
}
그리고 이것은 호출입니다 : pictureBox1.Image = RotateImage(pictureBox1.Image, someInt);
모든 것은 시작에 괜찮지 만, 더 많은 시간이 더 투명 이미지를하게 전달합니다. 잠시 후 거의 보이지 않습니다. 나는이 방법을 몇몇 포럼에서 발견했다. 나는 그것을 직접 쓰지 않았다. 이견있는 사람 ?