WPF Image控件使用本地图片

        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;   

 

你可能感兴趣的:(image)