0
アプリケーションパッケージ外のImageSourceを変更するにはどうすればよいですか?私はこれを使用しています:ImageSourceをアプリケーションパッケージ外のパスに設定する
FileOpenPicker picker = new FileOpenPicker();
picker.FileTypeFilter.Add(".jpg");
StorageFile file = await picker.PickSingleFileAsync();
if (file != null)
{
grid.Background = new ImageBrush
{
ImageSource = new BitmapImage(new Uri(file.Path, UriKind.Absolute))
};
}
しかし、私が望む画像を選んだ後、それはグリッドの背景として表示されません。それは何も表示されません!ここにXAMLがあります。
<Border BorderBrush="Black" BorderThickness="1" Margin="315,260,85,140" Width="100" Height="100">
<Grid x:Name="grid" Margin="0" Visibility="Visible">
</Grid>
</Border>
ありがとうございます!
おかげであなたを! –