BitmapDecoder.Create 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 BitmapDecoder 및 BitmapCreateOptions을 사용하여 BitmapCacheOption를 만듭니다.
오버로드
Create(Stream, BitmapCreateOptions, BitmapCacheOption)
지정된 BitmapDecoder 및 Stream을 사용하여 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 및 Stream을 사용하는 BitmapCreateOptions의 BitmapCacheOption입니다.
예제
다음 예제에서는 메서드를 사용하여 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)
지정된 BitmapDecoder 및 Uri을 사용하여 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
매개 변수
- createOptions
- BitmapCreateOptions
이 디코더의 BitmapCreateOptions를 식별합니다.
- cacheOption
- BitmapCacheOption
이 디코더의 BitmapCacheOption를 식별합니다.
반환
지정된 BitmapDecoder 및 Uri을 사용하는 BitmapCreateOptions의 BitmapCacheOption입니다.
예외
bitmapUri이 null인 경우
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, BitmapCreateOptions 및 BitmapCacheOption를 사용하여 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, Uri 및 BitmapCreateOptions를 사용하는 BitmapCacheOption의 RequestCachePolicy입니다.
설명
Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy) .NET Framework 버전 3.5에서에서 도입 되었습니다.