Aplicativos do Windows
Recolher sumário
Expandir sumário
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

BitmapSource.SetSource method

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

Syntax


Public Sub SetSource(
  streamSource As IRandomAccessStream 
)

Parameters

streamSource

Type: IRandomAccessStream

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Media.Imaging
Windows::UI::Xaml::Media::Imaging [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Imaging
Windows::UI::Xaml::Media::Imaging [C++]

Metadata

Windows.winmd

See also

BitmapSource
SetSourceAsync
UriSource
Imaging

 

 

Mostrar:
© 2016 Microsoft