Sunday, April 3, 2011

WriteableBitmap unavailable?

I've discovered what may be the perfect answer to a question on buffered drawing, but for some reason my version of VS2008 doesn't seem to have a WriteableBitmap? I've tried including the relevent namespaces as per the documentation:

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

But that just gives me errors:

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

Do I have an older version of .net installed or something? Is there any way to tell what version visual studio is using? I've updated VS to service pack 1 which made no difference.

From stackoverflow
  • You must target .Net framework 3.0 or 3.5 to get this. Also you will need to add a ref to PresentationCore.dll.

    Jon Cage : Thanks, I was missing two references as it turns out: 'WindowsBase' and 'PresentationCore'

0 comments:

Post a Comment