BitmapImage bi = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.BeginInit(); StreamResourceInfo info = Application.GetRemoteStream(new Uri("Test.jpg", UriKind.Relative)); bi.StreamSource = info.Stream; bi.EndInit(); // Set the image source. IMTest.Source = bi;
WPF Image控件使用本地图片
时间: 2024-11-09 04:04:28