BitmapDecoder::Create Method (Stream^, BitmapCreateOptions, BitmapCacheOption)

 

Creates a BitmapDecoder from a Stream by using the specified BitmapCreateOptions and BitmapCacheOption.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

public:
static BitmapDecoder^ Create(
	Stream^ bitmapStream,
	BitmapCreateOptions createOptions,
	BitmapCacheOption cacheOption
)

Parameters

bitmapStream
Type: System.IO::Stream^

The file stream that identifies the bitmap to decode.

createOptions
Type: System.Windows.Media.Imaging::BitmapCreateOptions

Identifies the BitmapCreateOptions for this decoder.

cacheOption
Type: System.Windows.Media.Imaging::BitmapCacheOption

Identifies the BitmapCacheOption for this decoder.

Use the OnLoad cache option if you wish to close the bitmapStream after the decoder is created. The default OnDemand cache option retains access to the stream until the bitmap is needed, and cleanup is handled by the garbage collector.

The following example demonstrates how to use the Create method to create a decoder for a given image. The first BitmapFrame of the image is used as the source of an Image control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: