WriteableBitmapDecodeToWidth Method
Loads a WriteableBitmap 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.ImagingAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static WriteableBitmap DecodeToWidth(
Stream stream,
int width,
BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality
)
Public Shared Function DecodeToWidth (
stream As Stream,
width As Integer,
Optional interpolationMode As BitmapInterpolationMode = BitmapInterpolationMode.HighQuality
) As WriteableBitmap
static member DecodeToWidth :
stream : Stream *
width : int *
?interpolationMode : BitmapInterpolationMode
(* Defaults:
let _interpolationMode = defaultArg interpolationMode BitmapInterpolationMode.HighQuality
*)
-> WriteableBitmap
- stream Stream
- The stream to read the bitmap from. This can be any supported image format.
- width Int32
- The desired width of the resulting bitmap.
- interpolationMode BitmapInterpolationMode (Optional)
- The BitmapInterpolationMode to use should any scaling be required.
WriteableBitmapAn instance of the
WriteableBitmap class.