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 초기화되면 속성 변경 내용이 무시됩니다.

적용 대상

추가 정보