Skip to main content

Fit

Controls how images are resized and positioned within specified dimensions while maintaining aspect ratio. Only effective when both width and height are specified.

enum Fit {
BOUNDS
COVER
CROP
}

Values

Fit.BOUNDS

Scales the image to fit entirely within the specified dimensions, preserving aspect ratio. May result in letterboxing or pillarboxing if aspect ratios don't match.

Fit.COVER

Scales the image to completely fill the specified dimensions, preserving aspect ratio. May crop parts of the image if aspect ratios don't match.

Fit.CROP

Resizes and crops the image from the center to exactly match the specified dimensions, potentially removing content from edges.

Member Of

TransformationInput input