Brunov's blog

Sergey Vyacheslavovich Brunov's blog

Using GDI+ in C++

2011-03-21 11:02:02 Moscow time

#undef WIN32_LEAN_AND_MEAN // Need some rarely-used stuff from Windows headers

#include <Winsock2.h> // Must precede windows.h if used at all.
#include <windows.h> // Needed for gdiplus.h
#include <gdiplus.h>
// Following are more carefully designed and vetted headers:
#include <windowsx.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <stdio.h>
#include <string>
#include <time.h>
#include <iostream>

Tech-Archive thread.

Another way:

#include <algorithm>
using std::min;
using std::max;
#include <windows.h>
#include <gdiplus.h>

Tags: cpp gdiplus