次の方法で共有


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。

依存関係プロパティ情報

品目 価値
識別子フィールド SourceProperty
に設定されたメタデータ プロパティ true AffectsMeasure,

AffectsRender

適用対象