ImageEn, unit iexBitmaps

TIEBitmap.AutoCrop

TIEBitmap.AutoCrop


Declaration

function AutoCrop(Tolerance: Integer; Background: TColor): TRect;


Description

Remove any bordering area of an image of a certain color.
If Background is clNone then transparent boundaries of the image will be cropped (using CropAlpha).

Parameter Description
Tolerance How closely we match the color to Background (0 to 255, where 0 matches only the specified color, and 255 would remove everything)
Background The border color to remove

Returns the area that was cropped.
If a border is not found the result will be a rect of (0, 0, w-1, h-1).

Note: AutoCrop() does not consider the alpha channel except when Background is clNone