TgaImage.Crop

Crop(Rectangle)

Crop the image to a specified region. This method allows you to define a rectangular area within the image to retain, discarding the rest. This operation is useful for focusing on specific content within the image or removing unwanted portions.

public override void Crop(Rectangle rectangle)
ParameterTypeDescription
rectangleRectangleThe rectangle.

See Also


Crop(int, int, int, int)

Crop the image by specifying shifts for the left, right, top, and bottom boundaries. This method allows you to trim the image by moving its boundaries independently along the horizontal and vertical axes. By adjusting these shifts, you can precisely control which portions of the image to retain, effectively cropping it to the desired dimensions.

public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
ParameterTypeDescription
leftShiftInt32The left shift.
rightShiftInt32The right shift.
topShiftInt32The top shift.
bottomShiftInt32The bottom shift.

See Also