Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.48 KB

bitmapsource_setsource_548578678.md

File metadata and controls

29 lines (19 loc) · 1.48 KB
-api-id -api-type
M:Windows.UI.Xaml.Media.Imaging.BitmapSource.SetSource(Windows.Storage.Streams.IRandomAccessStream)
winrt method

Windows.UI.Xaml.Media.Imaging.BitmapSource.SetSource

-description

Sets the source image for a BitmapSource by accessing a stream. Most callers should use SetSourceAsync instead.

-parameters

-param streamSource

The stream source that sets the image source value.

-remarks

Calling SetSource rather than SetSourceAsync has the potential to block the UI thread until the image source file is returned and processed. It is for this reason that we generally recommend calling SetSourceAsync instead of calling SetSource.

In low memory situations (most likely on lower-memory phones), it is possible for an exception to be raised with the message "The image is unrecognized" and an HRESULT of 0x88982F60. While this exception ordinarily indicates bad data, if your app is close to its memory limit then the cause of the exception is likely to be low memory. In that case, we recommend that you free memory and try again.

-examples

-see-also

SetSourceAsync, UriSource, Imaging