Summary
Loads a Bitmap from a stream and decodes at the desired width. Aspect ratio is maintained.
This is more efficient than loading and then resizing.
- Namespace
- Avalonia
.Media .Imaging - Containing Type
- Bitmap
Syntax
public static Bitmap DecodeToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode = HighQuality)
Parameters
Name | Type | Description |
---|---|---|
stream | Stream | The stream to read the bitmap from. This can be any supported image format. |
width | int | The desired width of the resulting bitmap. |
interpolationMode | Bitmap |
The BitmapInterpolationMode to use should any scaling be required. |