Rectangle rectangle = new Rectangle(); rectangle.Height = 100; rectangle.Width = 100; rectangle.X = 100; rectangle.Y = 100; Bitmap temp = new Bitmap(varas.ptval, varas.ptval.Width,varas.ptval.Height); temp = varas.ptval; var croppedImagem = cropBitmap(temp, rectangle); croppedImagem.Save(paths + "\\" + "SPR_" + i + ".jpeg", ImageFormat.Jpeg); public static Bitmap CropBitmap(Bitmap bitmap, int x, int y, int w, int h) { Rectangle rect = new Rectangle(x, y, w, h); Bitmap cropped = bitmap.Clone(rect, bitmap.PixelFormat); return cropped; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)