gpt4 book ai didi

c# - C# WPF 项目中缺少 "Bitmap"命名空间

转载 作者:行者123 更新时间:2023-12-04 16:53:24 26 4
gpt4 key购买 nike

我需要使用命名空间“System.Drawing”中的“Bitmap”,但没有这样的东西。如果我创建“Windows 窗体应用程序”,就不会有这样的问题。

如何在我的 WPF 项目中使用这个“位图”(添加包含位图类的命名空间)?
我使用 Microsoft Visual Studio 2015 RC。

最佳答案

This is my problem. System.Drawing not contain "Bitmap" namespace in WPF project, but when i create Windows Forms application there is Bitmap.



这是因为 WinForm 引用了 System.Drawing默认情况下,但 WFP 没有。因此您需要手动添加此引用(右键单击解决方案资源管理器 -> 引用 -> 添加引用...)。

关于c# - C# WPF 项目中缺少 "Bitmap"命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31635193/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com