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