BitmapDecoder.Create 메서드

정의

지정된 BitmapDecoderBitmapCreateOptions을 사용하여 BitmapCacheOption를 만듭니다.

오버로드

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

지정된 BitmapDecoderStream을 사용하여 BitmapCreateOptions에서 BitmapCacheOption를 만듭니다.

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

지정된 BitmapDecoderUri을 사용하여 BitmapCreateOptions에서 BitmapCacheOption를 만듭니다.

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

지정된 BitmapDecoder, Uri, BitmapCreateOptionsBitmapCacheOption를 사용하여 RequestCachePolicy를 만듭니다.

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

지정된 BitmapDecoderStream을 사용하여 BitmapCreateOptions에서 BitmapCacheOption를 만듭니다.

public:
 static System::Windows::Media::Imaging::BitmapDecoder ^ Create(System::IO::Stream ^ bitmapStream, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public static System.Windows.Media.Imaging.BitmapDecoder Create (System.IO.Stream bitmapStream, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
static member Create : System.IO.Stream * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.BitmapDecoder
Public Shared Function Create (bitmapStream As Stream, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption) As BitmapDecoder

매개 변수

bitmapStream
Stream

디코딩할 비트맵을 식별하는 파일 스트림입니다.

createOptions
BitmapCreateOptions

이 디코더의 BitmapCreateOptions를 식별합니다.

cacheOption
BitmapCacheOption

이 디코더의 BitmapCacheOption를 식별합니다.

반환

BitmapDecoder

지정된 BitmapDecoderStream을 사용하는 BitmapCreateOptionsBitmapCacheOption입니다.

예제

다음 예제에서는 메서드를 사용하여 Create 지정된 이미지에 대한 디코더를 만드는 방법을 보여 줍니다. 이미지의 첫 번째 BitmapFrame 컨트롤의 Image 소스로 사용 됩니다.

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];
Dim imageStream As FileStream = New FileStream("sampleImages/waterlilies.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)

Dim streamBitmap As BitmapDecoder = BitmapDecoder.Create(imageStream, BitmapCreateOptions.None, BitmapCacheOption.Default)

' Create an image element;
Dim streamImage As New Image()
streamImage.Width = 200
' Set image source using the first frame.
streamImage.Source = streamBitmap.Frames(0)

설명

디코더를 OnLoad 만든 후 닫 bitmapStream 으려면 캐시 옵션을 사용합니다. 기본 OnDemand 비트맵 필요 하지 않으며 정리 가비지 수집기에 의해 처리 될 때까지 캐시 옵션 스트림에 대 한 액세스를 유지 합니다.

추가 정보

적용 대상

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

지정된 BitmapDecoderUri을 사용하여 BitmapCreateOptions에서 BitmapCacheOption를 만듭니다.

public:
 static System::Windows::Media::Imaging::BitmapDecoder ^ Create(Uri ^ bitmapUri, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public static System.Windows.Media.Imaging.BitmapDecoder Create (Uri bitmapUri, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
static member Create : Uri * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.BitmapDecoder
Public Shared Function Create (bitmapUri As Uri, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption) As BitmapDecoder

매개 변수

bitmapUri
Uri

디코딩할 비트맵의 Uri입니다.

createOptions
BitmapCreateOptions

이 디코더의 BitmapCreateOptions를 식별합니다.

cacheOption
BitmapCacheOption

이 디코더의 BitmapCacheOption를 식별합니다.

반환

BitmapDecoder

지정된 BitmapDecoderUri을 사용하는 BitmapCreateOptionsBitmapCacheOption입니다.

예외

bitmapUrinull인 경우

bitmapUri가 지원되지 않는 형식 유형의 클래스 ID를 지정하는 경우

예제

다음 예제에서는 메서드를 사용하여 Create(Uri, BitmapCreateOptions, BitmapCacheOption) 지정된 이미지에 대한 디코더를 만드는 방법을 보여 줍니다. 이미지의 첫 번째 BitmapFrame 컨트롤의 Image 소스로 사용 됩니다.

BitmapDecoder uriBitmap = BitmapDecoder.Create(
   new Uri("sampleImages/waterlilies.jpg", UriKind.Relative),
   BitmapCreateOptions.None,
   BitmapCacheOption.Default);

// Create an image element;
Image uriImage = new Image();
uriImage.Width = 200;
// Set image source.
uriImage.Source = uriBitmap.Frames[0];
Dim uriBitmap As BitmapDecoder = BitmapDecoder.Create(New Uri("sampleImages/waterlilies.jpg", UriKind.Relative), BitmapCreateOptions.None, BitmapCacheOption.Default)

' Create an image element;
Dim uriImage As New Image()
uriImage.Width = 200
' Set image source.
uriImage.Source = uriBitmap.Frames(0)

추가 정보

적용 대상

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

지정된 BitmapDecoder, Uri, BitmapCreateOptionsBitmapCacheOption를 사용하여 RequestCachePolicy를 만듭니다.

public:
 static System::Windows::Media::Imaging::BitmapDecoder ^ Create(Uri ^ bitmapUri, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption, System::Net::Cache::RequestCachePolicy ^ uriCachePolicy);
public static System.Windows.Media.Imaging.BitmapDecoder Create (Uri bitmapUri, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption, System.Net.Cache.RequestCachePolicy uriCachePolicy);
static member Create : Uri * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption * System.Net.Cache.RequestCachePolicy -> System.Windows.Media.Imaging.BitmapDecoder
Public Shared Function Create (bitmapUri As Uri, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption, uriCachePolicy As RequestCachePolicy) As BitmapDecoder

매개 변수

bitmapUri
Uri

BitmapDecoder를 만드는 데 사용되는 비트맵의 위치입니다.

createOptions
BitmapCreateOptions

BitmapDecoder을 만드는 데 사용되는 옵션입니다.

cacheOption
BitmapCacheOption

BitmapDecoder을 만드는 데 사용되는 캐시 옵션입니다.

uriCachePolicy
RequestCachePolicy

BitmapDecoder에 대한 캐싱 요구 사항입니다.

반환

BitmapDecoder

지정된 BitmapDecoder, UriBitmapCreateOptions를 사용하는 BitmapCacheOptionRequestCachePolicy입니다.

설명

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy) .NET Framework 버전 3.5에서에서 도입 되었습니다.

적용 대상