The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
BitmapDecoder.Create Method (Stream, BitmapCreateOptions, BitmapCacheOption)
.NET Framework 3.0
Creates a BitmapDecoder from a Stream by using the specified BitmapCreateOptions and BitmapCacheOption.
Namespace: System.Windows.Media.Imaging
Assembly: PresentationCore (in presentationcore.dll)
Assembly: PresentationCore (in presentationcore.dll)
public static BitmapDecoder Create ( Stream bitmapStream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption )
public static BitmapDecoder Create ( Stream bitmapStream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption )
public static function Create ( bitmapStream : Stream, createOptions : BitmapCreateOptions, cacheOption : BitmapCacheOption ) : BitmapDecoder
You cannot use methods in XAML.
Parameters
- bitmapStream
The file stream that identifies the bitmap to decode.
- createOptions
Identifies the BitmapCreateOptions for this decoder.
- cacheOption
Identifies the BitmapCacheOption for this decoder.
Return Value
A new BitmapDecoder.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.
Stream imageStream = new FileStream("sampleImages/waterlilies.jpg", FileMode.Open, FileAccess.Read, FileShare.Read); BitmapDecoder streamBitmap = BitmapDecoder.Create( imageStream, BitmapCreateOptions.None, BitmapCacheOption.Default); // Create an image element; Image streamImage = new Image(); streamImage.Width = 200; // Set image source using the first frame. streamImage.Source = streamBitmap.Frames[0];
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.