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 요소의 SourceImage 결과로 사용됩니다.


// 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 특성에는 서로 다른 크기, 해상도 또는 색상표를 비롯한 여러 특성이 있을 수 있습니다.

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

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

생성자

Name Description
BitmapDecoder()

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

속성

Name Description
CodecInfo

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

ColorContexts

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

Dispatcher

연결된 이 값을 DispatcherDispatcherObject 가져옵니다.

(다음에서 상속됨 DispatcherObject)
Frames

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

IsDownloading

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

Metadata

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

Palette

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

Preview

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

Thumbnail

BitmapSource 비트맵이 정의된 경우 비트맵의 축소판 그림을 나타내는 값을 가져옵니다.

메서드

Name Description
CheckAccess()

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

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

지정된 및 .을 BitmapDecoder 사용하여 a Stream 에서 a를 BitmapCreateOptions 만듭니 BitmapCacheOption다.

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

BitmapDecoder 지정된 및 을 사용하여 a Uri 에서 a를 BitmapCreateOptionsBitmapCacheOptionRequestCachePolicy만듭니다.

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

지정된 및 .을 BitmapDecoder 사용하여 a Uri 에서 a를 BitmapCreateOptions 만듭니 BitmapCacheOption다.

CreateInPlaceBitmapMetadataWriter()

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

Equals(Object)

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

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

가비지 수집에서 리소스를 회수하기 전에 BitmapDecoder 리소스를 해제하고 다른 정리 작업을 수행합니다.

GetHashCode()

기본 해시 함수로 사용됩니다.

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

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

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

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

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

의 현재 값을 .로 BitmapDecoderString변환합니다.

VerifyAccess()

호출 스레드가 이에 DispatcherObject액세스할 수 있도록 합니다.

(다음에서 상속됨 DispatcherObject)

이벤트

Name Description
DownloadCompleted

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

DownloadFailed

비트맵 콘텐츠를 다운로드하지 못한 경우에 발생합니다.

DownloadProgress

비트맵 콘텐츠 다운로드가 BitmapDecoder 진행되면 발생합니다.

적용 대상

추가 정보