问题
I am currently using Graphics, Image, Color, and Bitmap Gdi+ classes in my C++ Application, but whenever I try to use BrightnessContrast and BrightnessContrastParams I get errors:
In Intellisense: Error: Namespace 'Gdiplus' has no member 'BrightnessContrast'
When Compiling: 'BrightnessContrast' : is not a member of 'Gdiplus'
What gives? I did find a forum post that said to add a line to "Additional Manifest Dependencies:" in the project properties, I did this but it still didn't work. The post goes on to say try looking in %windir%\winsxs if that doesn't work but I don't see how to make sense of the files in that directory. I am using VisualStudio 2010 on Windows7 64bit.
Also, I am aware that I can create my own Brightness and Contrast functions. I am wondering why I can't use the build-in Classes that are documented on MSDN.
Thanks
回答1:
These members are only available in GDI+ version 1.10, the version that shipped first with Vista. You have to explicitly opt-in to use them. Like this:
#define GDIPVER 0x110
#include <gdiplus.h>
Beware that your program won't run on XP when you do this.
来源:https://stackoverflow.com/questions/13317161/use-brightnesscontrast-class-in-gdiplus-c