Bitmap.

DecodeToWidth(Stream, int, BitmapInterpolationMode) Method

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 BitmapInterpolationMode The BitmapInterpolationMode to use should any scaling be required.

Return Value

Type Description
Bitmap An instance of the Bitmap class.