BitmapImage.EndInit 메서드

정의

BitmapImage 초기화가 끝났음을 나타냅니다.

public:
 virtual void EndInit();
public void EndInit ();
abstract member EndInit : unit -> unit
override this.EndInit : unit -> unit
Public Sub EndInit ()

구현

예외

UriSource 또는 StreamSource 속성이 null인 경우

또는

먼저 EndInit()를 호출하지 않고 BeginInit() 메서드를 호출한 경우

예제

다음 예제에서는 초기화 하는 방법을 보여 줍니다는 BitmapImage 집합을 사용 하 여 속성을 사용 하 여 합니다 BeginInitEndInit 메서드.

// 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)

설명

간의 속성 초기화를 수행 해야 BeginInitEndInit 호출 합니다. 한 번의 BitmapImage 되었습니다 초기화 속성 변경은 무시 됩니다.

적용 대상

추가 정보