我需要动态设置图片来源,需要注意的是我的图片存储在网络上某个位置,以下是我的代码:
BitmapImage logo = new BitmapImage();
logo.BeginInit();
logo.UriSource = new Uri(@"pack://application:,,,\\myserver\\folder1\\Customer Data\\sample.png");
logo.EndInit(); // Getting the exception here
ImageViewer1.Source = logo;
异常:
URI 前缀未被识别
myImage.Source = new BitmapImage (new Uri (new Uri (Directory.GetCurrentDirectory(), UriKind.Absolute), new Uri (@"/Images/foo.png", UriKind.Relative)));
- Thought