Use BrightnessContrast class in Gdiplus C++

泄露秘密 提交于 2020-04-30 07:49:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!