를 회전하는 방법 이미지를 회전하여 문제를 해결하기 위해 필요하지만, 나는 완전히PictureBox를
public static Image RotateImage(Image img, float rotationAngle)
{
//create an empty Bitmap image
Bitmap bmp = new Bitmap(img.Width, img.Height);
//turn the Bitmap into a Graphics object
Graphics gfx = Graphics.FromImage(bmp);
//now we set the rotation point to the center of our image
gfx.TranslateTransform((float)bmp.Width/2, (float)bmp.Height/2);
//now rotate the image
gfx.RotateTransform(rotationAngle);
gfx.TranslateTransform(-(float)bmp.Width/2, -(float)bmp.Height/2);
//set the InterpolationMode to HighQualityBicubic so to ensure a high
//quality image once it is transformed to the specified size
gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;
//now draw our new image onto the graphics object
gfx.DrawImage(img, new System.Drawing.Point(0, 0));
//dispose of our Graphics object
gfx.Dispose();
//return the image
return bmp;
}
을 돌려 메서드를 호출하려면이 옵션을 사용하지 않는 이미지를 회전하려면이 코드가 있습니다. 권리는 포함 이미지 사각형을 회전, 이미지
Bitmap bitmap = (Bitmap)Pix.Image;
Pix.Image = (Bitmap)(RotateImage(bitmap, 20.0f));
중복 가능성 [LockBits 이미지 회전 방법은 작동하지? (http://stackoverflow.com/questions/3860030/lockbits-image-rotation-method-not-working) –