PeachImage
PeachImage
ResizeMode Enum
How ResizeOptions interprets the width/height passed to Resize(int, int, ResizeOptions)/Resize(int, int, ResizeOptions).
public enum ResizeMode
Fields
Exact 0
Resize to exactly the given width and height, ignoring aspect ratio. The default.
Max 1
Treat the given width/height as a bounding box: scale down to the largest size that fits within it while preserving aspect ratio. Shrink-only — if the source already fits, it’s returned unchanged rather than upscaled.
Crop 2
Scale to fill (cover) the given width/height while preserving aspect ratio, then crop the overflow so the result is exactly the requested size. Unlike Max, this can upscale. Which part of the source survives cropping is controlled by Anchor.
Pad 3
Scale to fit within the given width/height while preserving aspect ratio (like Max, but without the shrink-only restriction — this can upscale), then pad the remainder so the result is exactly the requested size. Where the source sits within the padded canvas is controlled by Anchor; the fill color by BackgroundColor.