![](/img/trans.png)
[英]Image.Source = new BitmapImage(); doesn't work in UWP
[英]Image.Source in new window
有几个图像。 按下图像打开。 如何传递我单击的该窗口图像?
image1.Source = new BitmapImage(new Uri();
...
imageN.Source = new BitmapImage(new Uri();
private void ShowPreview(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
PopupWnd ww=new PopupWnd();
ww.PopImage.Source = new BitmapImage(new Uri(??? need imageN));
ww.Show();
}
如果我对您的理解比:
void _imageN_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var image = sender as Image;
var imageSource = image.Source as BitmapImage;
imageSource.BaseUri.ToString(); //here it is your Uri
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.