#include <GdiPlus.h> using namespace Gdiplus; #pragma comment(lib, "Gdiplus.lib") BYTE* pImageData = new BYTE[nImageWidth * 4 * nImageHeight]; Bitmap bmp(nImageWidth, nImageHeight, 4 * nImageWidth, PixelFormat32bppARGB, pImageData);