Crops an image.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public sealed class Crop : Transform
Crop transform returns pixels which are inside of the cropping rectangle (see Rectangle property).
The following code crops a 50*100 pixels rectangle from an image and saves the result in JPEG format.
using (var bitmap = new Bitmap(@"Images\in.jpg")) { var cropRectangle = new System.Drawing.Rectangle(50, 60, 50, 100); using (var crop = new Crop(cropRectangle)) using (var result = crop.Apply(bitmap)) result.Save(@"Images\Output\out.jpg"); }