CroppedBitmap 생성자

정의

CroppedBitmap 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
CroppedBitmap()

CroppedBitmap 클래스의 새 인스턴스를 초기화합니다.

CroppedBitmap(BitmapSource, Int32Rect)

지정된 클래스와 .가 있는 클래스의 CroppedBitmap 새 인스턴스를 Source 초기화합니다 SourceRect.

CroppedBitmap()

CroppedBitmap 클래스의 새 인스턴스를 초기화합니다.

public:
 CroppedBitmap();
public CroppedBitmap();
Public Sub New ()

설명

CroppedBitmap 는 인터페이스를 ISupportInitialize 구현하여 여러 속성에서 초기화를 최적화합니다. 이 생성자를 사용하여 만든 생성자를 초기화 CroppedBitmap 하려면 호출 간에 BeginInitEndInit 속성 초기화를 수행해야 합니다.

적용 대상

CroppedBitmap(BitmapSource, Int32Rect)

지정된 클래스와 .가 있는 클래스의 CroppedBitmap 새 인스턴스를 Source 초기화합니다 SourceRect.

public:
 CroppedBitmap(System::Windows::Media::Imaging::BitmapSource ^ source, System::Windows::Int32Rect sourceRect);
public CroppedBitmap(System.Windows.Media.Imaging.BitmapSource source, System.Windows.Int32Rect sourceRect);
new System.Windows.Media.Imaging.CroppedBitmap : System.Windows.Media.Imaging.BitmapSource * System.Windows.Int32Rect -> System.Windows.Media.Imaging.CroppedBitmap
Public Sub New (source As BitmapSource, sourceRect As Int32Rect)

매개 변수

source
BitmapSource

SourceCroppedBitmap 인스턴스의 형식입니다.

sourceRect
Int32Rect

SourceRectCroppedBitmap 인스턴스의 형식입니다.

예외

sourcenull입니다.

sourceRect 가 .의 source경계를 벗어났습니다.

예제

다음 예제에서는 클래스의 새 인스턴스를 초기화하는 데 사용하는 CroppedBitmap(BitmapSource, Int32Rect) 방법을 보여 줍니다 CroppedBitmap .

// Create an Image element.
Image chainImage = new Image();
chainImage.Width = 200;
chainImage.Margin = new Thickness(5);

// Create the cropped image based on previous CroppedBitmap.
CroppedBitmap chained = new CroppedBitmap(cb,
   new Int32Rect(30, 0, (int)cb.Width-30, (int)cb.Height)); 
// Set the image's source.
chainImage.Source = chained;
' Create an Image element.
Dim chainImage As New Image()
chainImage.Width = 200
chainImage.Margin = New Thickness(5)

' Create the cropped image based on previous CroppedBitmap.
Dim chained As New CroppedBitmap(cb, New Int32Rect(30, 0, CType(cb.Width, Integer) - 30, CType(cb.Height, Integer)))
' Set the image's source.
chainImage.Source = chained

설명

CroppedBitmap 이 생성자를 사용하여 만든 개체는 자동으로 초기화됩니다. 초기화 후에는 속성 변경 내용이 무시됩니다.

적용 대상