Method Crop
Crop(int, int, int, int)
Returns a new ImageBuffer containing a copy of the specified rectangular region. The source buffer is not modified.
public ImageBuffer Crop(int x, int y, int width, int height)
Parameters
xintLeft coordinate of the crop region (pixels).
yintTop coordinate of the crop region (pixels).
widthintWidth of the crop region (pixels).
heightintHeight of the crop region (pixels).
Returns
- ImageBuffer
A new buffer containing the cropped pixels.
Exceptions
- ArgumentOutOfRangeException
Thrown when the crop region extends outside the image bounds, or
width/heightis not positive.