다음을 통해 공유


Image.Source 속성

정의

이미지의 값을 ImageSource 가져오거나 설정합니다.

public:
 property System::Windows::Media::ImageSource ^ Source { System::Windows::Media::ImageSource ^ get(); void set(System::Windows::Media::ImageSource ^ value); };
public System.Windows.Media.ImageSource Source { get; set; }
member this.Source : System.Windows.Media.ImageSource with get, set
Public Property Source As ImageSource

속성 값

그린 이미지의 원본입니다. 기본값은 null입니다.

예제

다음 예제에서는 속성을 사용 하는 방법을 보여 줍니다 Source .

Image^ myImage3 = gcnew Image();
BitmapImage^ bi3 = gcnew BitmapImage();
bi3->BeginInit();
bi3->UriSource = gcnew System::Uri("smiley_stackpanel.PNG", UriKind::Relative);
bi3->EndInit();
myImage3->Stretch = Stretch::Fill;
myImage3->Source = bi3;
Image myImage3 = new Image();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri("smiley_stackpanel.PNG", UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
Dim myImage3 As New Image
Dim bi3 As New BitmapImage
bi3.BeginInit()
bi3.UriSource = New Uri("smiley_stackpanel.PNG", UriKind.Relative)
bi3.EndInit()
myImage3.Stretch = Stretch.Fill
myImage3.Source = bi3
<Image Source="smiley_stackpanel.png" Stretch="Fill"/>

설명

XAML 특성 사용

<object Source="imageUri"/>

XAML 텍스트 사용

XAML 정보는 형식을 참조하세요 ImageSource .

XAML 값

imageUriSystem.String

이미지 파일의 URI입니다.

종속성 속성 정보

Item 가치
식별자 필드 SourceProperty
메타데이터 속성이 다음으로 설정됩니다. true AffectsMeasure;

AffectsRender

적용 대상