[C++] Get Image Data(Byte Array) From HBITMAP
//BYTE pImageData[IMAGESIZE];
void GetImageDataFromHBITMAP(HDC hdc, HBITMAP bitmap, BYTE* pImageData)
{
BITMAPINFO bmpInfo;
memset(&bmpInfo, 0, sizeof(BITMAPINFOHEADER));
bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
GetDIBits(hdc, bitmap, 0, 0, NULL, &bmpInfo, DIB_RGB_COLORS);
bmpInfo.bmiHeader.biBitCount = 32;
bmpInfo.bmiHeader.biCompression = BI_RGB;
GetDIBits(hdc, bitmap, 0, bmpInfo.bmiHeader.biHeight, pImageData, &bmpInfo, DIB_RGB_COLORS);
}