i have one crop button image to crop image using jquery while selecting area for the crop image area selecting but when press crop button the image is not croping and displaying in image canvas below is my code kindly please suggest me.
- string filename = "~/CapturedImage/"+ DateTime.Now.ToString("dd-MM-yy hh-mm") + ".jpg";
-
- string FilePath = Path.Combine(Server.MapPath("~/CapturedImage"));
- int x = Convert.ToInt32(X.Value);
- int y = Convert.ToInt32(Y.Value);
- int w = Convert.ToInt32(W.Value);
- int h = Convert.ToInt32(H.Value);
-
- if (File.Exists(filename))
- {
- System.Drawing.Image image = Bitmap.FromFile(HttpContext.Current.Request.PhysicalApplicationPath + @"\CapturedImage\" + DateTime.Now.ToString("dd-MM-yy hh-mm") + ".jpg");
- Bitmap bmpimage = new Bitmap(w, h, image.PixelFormat);
- Graphics grpx = Graphics.FromImage(bmpimage);
- grpx.DrawImage(image, new Rectangle(0, 0, w, h), new Rectangle(x, y, w, h), GraphicsUnit.Pixel);
- bmpimage.Save(HttpContext.Current.Request.PhysicalApplicationPath + @"\CroppedImage\" + DateTime.Now.ToString("dd-MM-yy hh-mm") + ".jpg", image.RawFormat);
- imgCapture.Dispose();
- bmpimage = null;
- imgCapture.ImageUrl = @"\CroppedImage\" + DateTime.Now.ToString("dd-MM-yy hh-mm") + ".jpg";
-