BitmapDecoder 클래스

정의

비트맵 프레임의 컨테이너를 나타냅니다. 각 비트맵 프레임은 BitmapSource입니다. 이 추상 클래스는 파생된 모든 디코더 개체에 대한 기본 기능 집합을 제공합니다.

public ref class BitmapDecoder abstract : System::Windows::Threading::DispatcherObject
public abstract class BitmapDecoder : System.Windows.Threading.DispatcherObject
type BitmapDecoder = class
    inherit DispatcherObject
Public MustInherit Class BitmapDecoder
Inherits DispatcherObject
상속
BitmapDecoder
파생

예제

다음 예제에서는 메서드를 사용하여 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)

다음 코드 예제에서는 기본 제공 TiffBitmapDecoder 을 사용하여 TIFF(태그가 지정된 이미지 파일 형식) 비트맵을 열고 디코딩하는 방법을 보여 줍니다. 결과는 BitmapSource 요소의 Source Image 결과로 사용됩니다.


// Open a Stream and decode a TIFF image
Stream imageStreamSource = new FileStream("tulipfarm.tif", FileMode.Open, FileAccess.Read, FileShare.Read);
TiffBitmapDecoder decoder = new TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapSource bitmapSource = decoder.Frames[0];

// Draw the Image
Image myImage1 = new Image();
myImage1.Source = bitmapSource;
myImage1.Stretch = Stretch.None;
myImage1.Margin = new Thickness(20);
' Open a Stream and decode a TIFF image
Dim imageStreamSource As New FileStream("tulipfarm.tif", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)

' Draw the Image
Dim myImage1 As New Image()
myImage1.Source = bitmapSource
myImage1.Stretch = Stretch.None
myImage1.Margin = New Thickness(20)

설명

BitmapDecoder 는 그 자체가 아니라 BitmapFrame 개체에 대한 BitmapFrame 컨테이너입니다. 컨테이너의 각 BitmapFrame 특성에는 서로 다른 크기, 해상도 또는 팔레트를 비롯한 여러 특성이 있을 수 있습니다.

특정 코덱을 선택하지 않는 한 WPF(Windows Presentation Foundation)는 자동 런타임 검색을 사용하여 이미지 형식을 식별하고 적절한 코덱과 일치합니다. 이 검색 프로세스를 통해 ISV(독립 소프트웨어 공급업체)에서 개발한 코덱을 시스템에서 자동으로 검색할 수 있습니다. 특정 코덱을 선택하려면 파생된 BitmapDecoder 코덱 또는 BitmapEncoder클래스와 같은 코덱을 TiffBitmapDecoder 사용해야 합니다.

태그가 지정된 TIFF(이미지 파일 형식) 및 GIF(그래픽 교환 형식)는 여러 프레임을 지원하는 유일한 구현된 이미지 형식입니다.

생성자

BitmapDecoder()

BitmapDecoder의 새 인스턴스를 초기화합니다.

속성

CodecInfo

이 코덱을 설명하는 정보를 가져옵니다.

ColorContexts

정의된 경우 비트맵에 연결된 색 프로필을 나타내는 값을 가져옵니다.

Dispatcher

Dispatcher와 연결된 DispatcherObject를 가져옵니다.

(다음에서 상속됨 DispatcherObject)
Frames

비트맵 내 개별 프레임의 콘텐츠를 가져옵니다.

IsDownloading

디코더가 현재 콘텐츠를 다운로드하는 중인지 여부를 나타내는 값을 가져옵니다.

Metadata

메타데이터가 정의된 경우 이 비트맵과 연결된 전역 메타데이터를 나타내는 BitmapMetadata의 인스턴스를 가져옵니다.

Palette

이 디코더와 연결된 BitmapPalette를 가져옵니다.

Preview

이 비트맵의 전역 미리 보기(정의된 경우)를 나타내는 BitmapSource를 가져옵니다.

Thumbnail

정의된 경우 비트맵의 미리 보기를 나타내는 BitmapSource를 가져옵니다.

메서드

CheckAccess()

호출 스레드가 이 DispatcherObject에 액세스할 수 있는지 여부를 확인합니다.

(다음에서 상속됨 DispatcherObject)
Create(Stream, BitmapCreateOptions, BitmapCacheOption)

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

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

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

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

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

CreateInPlaceBitmapMetadataWriter()

비트맵의 메타데이터를 업데이트하는 데 사용할 수 있는 InPlaceBitmapMetadataWriter의 인스턴스를 만듭니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Finalize()

가비지 컬렉션에 의해 BitmapDecoder가 회수되기 전에 리소스를 해제하고 기타 정리 작업을 수행합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

BitmapDecoder의 현재 값을 String으로 변환합니다.

VerifyAccess()

호출 스레드에서 이 DispatcherObject에 액세스할 수 있는지 확인합니다.

(다음에서 상속됨 DispatcherObject)

이벤트

DownloadCompleted

BitmapDecoder에서 비트맵 콘텐츠 다운로드가 완료되면 발생합니다.

DownloadFailed

비트맵 콘텐츠 다운로드가 실패하면 발생합니다.

DownloadProgress

BitmapDecoder에서 비트맵 콘텐츠를 다운로드하는 중이면 발생합니다.

적용 대상

추가 정보