int iBmpSize = cd.nTotleLen; HGLOBAL hMemBmp = GlobalAlloc(GMEM_FIXED, iBmpSize); IStream* pStmBmp = NULL; CreateStreamOnHGlobal(hMemBmp, FALSE, &pStmBmp); m_pbyBmp = (BYTE *)GlobalLock(hMemBmp); memcpy(m_pbyBmp, m_data, cd.nTotleLen); //Image *image = Image::FromStream(pStmBmp); image = Image::FromStream(pStmBmp);
参考:https://blog.csdn.net/zhonghongjun/article/details/46413055