代码
//分配一份内存
HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, a.size());
//锁定内存
BYTE* pmem = (BYTE*)GlobalLock(hMem);
memcpy(pmem,a.begin(),a.size());
CComPtr<IStream> pstm = NULL;
CreateStreamOnHGlobal(hMem,FALSE,&pstm);
Gdiplus::Bitmap* pTileBmp = Gdiplus::Bitmap::FromStream(pstm, false);
//解锁
GlobalUnlock(hMem);
//释放
GlobalFree(hMem);
HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, a.size());
//锁定内存
BYTE* pmem = (BYTE*)GlobalLock(hMem);
memcpy(pmem,a.begin(),a.size());
CComPtr<IStream> pstm = NULL;
CreateStreamOnHGlobal(hMem,FALSE,&pstm);
Gdiplus::Bitmap* pTileBmp = Gdiplus::Bitmap::FromStream(pstm, false);
//解锁
GlobalUnlock(hMem);
//释放
GlobalFree(hMem);