public static void RotateImage(Image imageToRotate, ImageRotationStyle style) { if (imageToRotate != null) { RotateFlipType flipType; switch (style) { case ImageRotationStyle.CCW: { flipType = RotateFlipType.Rotate90FlipXY; break; } default: { flipType = RotateFlipType.Rotate270FlipXY; break; } } imageToRotate.RotateFlip(flipType); } }