ResizeMode Enum
Controls how the target size of a resize is interpreted.
public enum ResizeModeFields
| Name | Value | Description |
|---|---|---|
Contain | 0 | Preserves the aspect ratio and fits the whole image within the target size, without padding: one dimension equals the target and the other is smaller or equal. This is the default. |
Stretch | 1 | Produces exactly the target size, ignoring the aspect ratio. |
Cover | 2 | Preserves the aspect ratio, covers the target size, and crops the overflow according to ResizeOptions.Anchor, producing exactly the target size. |
Pad | 3 | Fits the whole image within the target size as ResizeMode.Contain does, then pads it to exactly the target size with ResizeOptions.BackgroundColor; the image is placed on the canvas according to ResizeOptions.Anchor (letterboxing). |
BoxPad | 4 | Pads the image to exactly the target size like ResizeMode.Pad, but never enlarges it: an image that already fits keeps its size and is only placed on the canvas, and a larger one is reduced as by ResizeMode.Pad. It is ResizeMode.Pad with ResizeOptions.AllowUpscaling set to false. |