用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);

} 

 

posted @ 2017-12-03 15:34  紫旭  阅读(1818)  评论(0编辑  收藏  举报