public JsonResult RotateImage(string url) { var image = new WebImage(_userImagesService.GetImageStream(url)); image.FileName = "rotated." + image.ImageFormat; image.RotateLeft(); return Json( _userImagesService.SaveUserImageStream( new MemoryStream(image.GetBytes()), image.FileName, image.ImageFormat, image.Height, image.Width), "text/plain"); }
public void GetImage(string horizontalFlip="", string verticalFlip="", string rotateLeft="", string rotateRight="") { var imagePath = Server.MapPath("~/images/bunny-peanuts.jpg"); var image = new WebImage(imagePath); if (!string.IsNullOrWhiteSpace(verticalFlip)) image = image.FlipVertical(); if (!string.IsNullOrWhiteSpace(horizontalFlip)) image = image.FlipHorizontal(); if (!string.IsNullOrWhiteSpace(rotateLeft)) image = image.RotateLeft(); if (!string.IsNullOrWhiteSpace(rotateRight)) image = image.RotateRight(); image.Write(); }