WriteableBitmap不可用?

时间:2009-06-29 00:13:58

标签: .net visual-studio-2008 c++-cli version writeablebitmap

我发现a question on buffered drawing可能是最完美的答案,但由于某些原因,我的VS2008版本似乎没有WriteableBitmap?我已经尝试按照文档包含相关的命名空间:

using namespace System::Windows::Media;
using namespace System::Windows::Media::Imaging;

但这只是给我错误:

d:\experiments\graphicscontrols\graphicscontrollib\GraphicsControlLibControl.h(9) : error C2039: 'Media' : is not a member of 'System::Windows'
d:\experiments\graphicscontrols\graphicscontrollib\GraphicsControlLibControl.h(10) : error C3083: 'Media': the symbol to the left of a '::' must be a type
d:\experiments\graphicscontrols\graphicscontrollib\GraphicsControlLibControl.h(10) : error C2039: 'Imaging' : is not a member of 'System::Windows'
d:\experiments\graphicscontrols\graphicscontrollib\GraphicsControlLibControl.h(52) : error C2065: 'WriteableBitmap' : undeclared identifier

我是否安装了旧版本的.net?有什么方法可以告诉视觉工作室使用的是哪个版本?我已将VS更新到Service Pack 1,这没有任何区别。

1 个答案:

答案 0 :(得分:0)

您必须以.Net framework 3.0或3.5为目标。此外,您还需要为PresentationCore.dll添加引用。