废话少说,直接上代码: 第一步: 第二步: 第三步: 第四步: App.xaml.cs对应的代码: using CefSharp; using CefSharp.Wpf; using System; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Windows; namespace CefSharpe { /// <summary> /// App.xa
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.En