If you define NOMINMAX, because you prefer the STL version, then you may get problems while including gdiplus.h, which uses the min/max macro. As solution you need to include the STL headers and use "using namespace std" before you include the gdiplus.h.
In example:
#define NOMINMAX
// Include C++ headers
#include <algorithm>
using namespace std;
// Include Windows headers
#include <windows.h>
#include <gdiplus.h>
不能直接在工程中添加NOMINMAX,必须这么处理才能OK