Skip to content

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-macos15.0, net9.0-desktop1.0, net9.0-ios18.0, net8.0, net8.0-maccatalyst17.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-macos14.5, netstandard2.1

public Task<IBitmap?> Load(Stream sourceStream, float? desiredWidth, float? desiredHeight)

Inherited documentation

These docs were inherited from IBitmapLoader. The member doesn't override them on this type.

Summary: Loads a bitmap from a byte stream.

Parameters

NameTypeDescription
sourceStreamStreamThe stream to load the image from.
desiredWidthfloat?The desired width of the image.
desiredHeightfloat?The desired height of the image.

Returns: Task -- A future result representing the loaded image.

Remarks

        Supplying both dimensions fits the image inside that box without distorting it; supplying one
        derives the other from the image's proportions. Only some codecs - JPEG in practice - can decode
        straight to a smaller size, so the rest are decoded whole and then resized.