Hi,
We are using System.Drawing.Image RotateFlip() method to rotate images and we found more time consumption while rotating an image with large size(17712, 24792). Kindly check the below code snippet and can you please suggest me how to reduce the time consumption?
private void RotateImage_Click(object sender, RoutedEventArgs e)
{
System.Drawing.Image image = new System.Drawing.Bitmap(17712, 24792);
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(image);
graphics.FillRectangle(System.Drawing.Brushes.White, new System.Drawing.Rectangle(0, 0, (int)(image.Width), (int)(image.Height)));
Stopwatch sw = new Stopwatch();
sw.Start();
image.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
System.Drawing.Image img = new System.Drawing.Bitmap(image, new System.Drawing.Size(image.Width, image.Height - 4));
image = img;
sw.Stop();
Debug.WriteLine("Elapsed: " + sw.ElapsedMilliseconds.ToString());
}
Regards,
Divya