用CImage加载内存里的Image(转)
void LoadMemImage( void * pMemData, long len) { HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, len); void * pData = GlobalLock(hGlobal); memcpy(pData, pMemData, len); GlobalUnlock(hGlobal); IStream * pStream = NULL; if (CreateStreamOnHGlobal(hGlobal, TRUE, & pStream) == S_OK) { CImage image; if (SUCCEEDED(image.Load(pStream))) { // .. } pStream -> Release(); } GlobalFree(hGlobal); }