Table of Contents

Method Crop

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

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

x int

Left coordinate of the crop region (pixels).

y int

Top coordinate of the crop region (pixels).

width int

Width of the crop region (pixels).

height int

Height 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/height is not positive.

Share