我收到以下编译时错误:
The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an assembly reference?)
这是我的代码:
BitmapImage img = new BitmapImage();
Run Code Online (Sandbox Code Playgroud)
use*_*567 19
今天(2020 年)是 nuGet package System.Drawing.Common.dll。添加它:右键单击项目名称(在解决方案资源管理器中)-->“管理 NuGet 包”--> 选择顶部的“浏览”标签--> 搜索“System.Drawing.Common”--> 安装它.
小智 6
添加PresentationCore作为参考.
PresentationCore程序集显示在项目的"参考"列表中.
为文件顶部的System.Windows.Media.Imaging命名空间添加using指令,这是BitmapImage生命的位置.
using System;
using System.Windows.Media.Imaging;
Run Code Online (Sandbox Code Playgroud)
也许您需要添加:
using System.Windows.Media.Imaging;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
42176 次 |
| 最近记录: |