ContentScale

Strategy used to fit an image's intrinsic size into the requested destination rectangle.

Modeled after the Compose API of the same name so cross-domain Compose developers can carry their intuition straight over to PdfKmp.

Entries

Link copied to clipboard

Scale the image so it fits inside the destination rectangle while preserving its aspect ratio. The image is centered; any unused space on one axis is left blank (letterboxing or pillarboxing). This is the safe default for arbitrary photos.

Link copied to clipboard

Scale the image so it fully covers the destination rectangle while preserving its aspect ratio. Excess content on one axis is cropped symmetrically. Useful for hero images and avatars where empty space looks worse than a tight crop.

Link copied to clipboard

Stretch the image to exactly match the destination rectangle, even if that distorts its aspect ratio. Use only when the source is already sized for the target rectangle (e.g. a generated chart) — otherwise the image will look squished.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.