BitmapImage.BeginInit 메서드

정의

BitmapImage 초기화가 시작되었음을 나타냅니다.

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

구현

예외

BitmapImage는 현재 초기화되고 있습니다. BeginInit()가 이미 호출되었습니다.

또는 BitmapImage이 이미 초기화되었습니다.

예제

다음 예제에서는 초기화 하는 방법을 보여 줍니다는 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 되었습니다 초기화 속성 변경은 무시 됩니다.

적용 대상

추가 정보