我有一个位图图像变量,我想将它绑定到我的XAML窗口。
你能帮我通过C#代码将这个位图变量绑定到这个XAML图像中吗?
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
string[] resources = thisExe.GetManifestResourceNames();
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SplashDemo.Resources.Untitled-100000.png");
Bitmap image = new Bitmap(stream);
这是我的 XAML 代码:
<Image Source="{Binding Source}" HorizontalAlignment="Left" Height="210" Margin="35,10,0,0" VerticalAlignment="Top" Width="335">
</Image>
你能帮我通过C#代码将这个位图变量绑定到这个XAML图像中吗?
BuildAction
设置为EmbeddedResource
。发布中。 - Adam