カスタムメソッドを使用して画像ボックスを回転させています。これはコードです:
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);
最初は大丈夫なのですが、時間が経つほど画像が透明になっていきます。しばらくするとほとんど見えなくなります。このメソッドはフォーラムで見つけましたが、自分で書いたことはありません。何かご意見は ?