BitmapCacheOption 열거형

정의

비트맵 이미지가 메모리 캐싱을 활용하는 방법을 지정합니다.

public enum class BitmapCacheOption
public enum BitmapCacheOption
type BitmapCacheOption = 
Public Enum BitmapCacheOption
상속
BitmapCacheOption

필드

Default 0

전체 이미지를 메모리에 캐시합니다. 기본값입니다.

None 2

메모리 저장소를 만들지 마세요. 이미지에 대한 모든 요청은 이미지 파일에서 직접 채웁니다.

OnDemand 0

요청된 데이터 전용 메모리 저장소를 만듭니다. 첫 번째 요청에서 이미지를 직접 로드하고 후속 요청은 캐시에서 채워집니다.

OnLoad 1

로드할 때 전체 이미지를 메모리에 캐시합니다. 이미지 데이터에 대한 모든 요청은 메모리 저장소에서 채워집니다.

예제

다음 코드 예제에 로드 하는 방법을 보여 줍니다.는 BitmapImage 지정은 BitmapCacheOption합니다.

// Define a BitmapImage.
Image myImage = new Image();
BitmapImage bi = new BitmapImage();

// Begin initialization.
bi.BeginInit();

// Set properties.
bi.CacheOption = BitmapCacheOption.OnDemand;
bi.CreateOptions = BitmapCreateOptions.DelayCreation;
bi.DecodePixelHeight = 125;
bi.DecodePixelWidth = 125;
bi.Rotation = Rotation.Rotate90;
MessageBox.Show(bi.IsDownloading.ToString());
bi.UriSource = new Uri("smiley.png", UriKind.Relative);

// End initialization.
bi.EndInit();
myImage.Source = bi;
myImage.Stretch = Stretch.None;
myImage.Margin = new Thickness(5);
' Define a BitmapImage.
Dim myImage As New Image()
Dim bi As New BitmapImage()

' Begin initialization.
bi.BeginInit()

' Set properties.
bi.CacheOption = BitmapCacheOption.OnDemand
bi.CreateOptions = BitmapCreateOptions.DelayCreation
bi.DecodePixelHeight = 125
bi.DecodePixelWidth = 125
bi.Rotation = Rotation.Rotate90
MessageBox.Show(bi.IsDownloading.ToString())
bi.UriSource = New Uri("smiley.png", UriKind.Relative)

' End initialization.
bi.EndInit()
myImage.Source = bi
myImage.Stretch = Stretch.None
myImage.Margin = New Thickness(5)

적용 대상

추가 정보