I am using rotateflip to rotate image and also save on server here is the code:
using (Image image = Image.FromFile(HttpContext.Current.Server.MapPath("~/Content/Job_Files/" + Job_ID + "/" + new_str + "/Images/" + path)))
{
//rotate the picture by 90 degrees and re-save the picture as a Jpeg
if (cbox_id == "cboxRight")
{
image.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
else
{
image.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
image.Save(new_path, System.Drawing.Imaging.ImageFormat.Jpeg);
image.Dispose();
}
Image is rotated at right side on click of rotate right but not working on left rotate..how to rotate it??
Both forks of your if statement contain the line:
image.RotateFlip(RotateFlipType.Rotate90FlipNone);
so, unless there's some serious magic going on, they'll both do exactly the same thing.
One of them should probably be:
image.RotateFlip(RotateFlipType.Rotate270FlipNone);
(rotation is always clockwise, so rotating 270 is identical to rotating -90).
Rotating 270 degrees clockwise is the same as rotating 90 degrees anticlockwise. so Use RotateFlipType.Rotate270FlipXor RotateFlipType.Rotate270FlipNone
Update: The provided options may be used as required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With