小编use*_*114的帖子

绑定 Xaml 位图图像

我有位图图像变量,我想将它绑定到我的 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);
Run Code Online (Sandbox Code Playgroud)

这是我的 xaml 代码

<Image Source="{Binding Source}" HorizontalAlignment="Left"  Height="210" Margin="35,10,0,0" VerticalAlignment="Top" Width="335">
    </Image>
Run Code Online (Sandbox Code Playgroud)

你能帮我通过 C# 代码将此位图变量绑定到这个 xaml 图像吗?

c# xaml bind bitmap

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

bind ×1

bitmap ×1

c# ×1

xaml ×1