首页 > 解决方案 > 如何在wpf中设置位图的来源

问题描述

我想从文件夹“图像”中设置位图的来源。该文件夹中图像的属性设置为

我可以在 Winform 中正确设置如下,

      Bitmap bmp_testing = TestAPP.Properties.Resources.testImg;

但是在 WPF 上我得到了错误 - 无效的参数。

   Bitmap bmp_testing  = new Bitmap("/images/testImg.png");

我不想使用 BitmapImage。请建议如何在 WPF 中设置位图的来源。

标签: c#wpfbitmap

解决方案


推荐阅读