当前位置:首页 » 多媒体相关

已知 bitmapinfoheader 和 图像数据,循环显示。


应该用什么方法显示?我用的tmemorystreat   +   image   就是不出图像。

推荐阅读

  • 长焦系列齐促销,低价购机还送256M SD卡! [详细内容]
  • 橘子香水 多普达Orange版830售2880南京 [详细内容]
  • 陆地最强 O2 Xda Atom Exec售3999元南京 [详细内容]
  • 嗜血冲击低端 盈通6200A/256M也卖499 [详细内容]
  • 玩儿转E398-视频相关 [详细内容]
  • CDMA智能机 UT斯达康XV6700售2780元南京 [详细内容]
  • 共享是精髓 京华256MB MP3强势促销 [详细内容]
  • 网友回答:
    网友:keiy

    要把bitmapinfoheader   转成bitmapfileheader才能显示  
      我有已知bitmapinfoheader写成bitmap文件的例子,你可参考一下:  
       
      bool   tmygraph::writedib(lptstr   szfile,   handle   hdib,   long   size)  
      {  
            bitmapfileheader   hdr;  
            lpbitmapinfoheader   lpbi;  
            if   (!hdib)  
                    return   false;  
       
            file*   file=0;  
       
            file   =   fopen(szfile,"wb");  
            if(!file)  
                    return   false;  
       
            lpbi   =   (lpbitmapinfoheader)hdib;  
       
            int   ncolors   =   1   <<   lpbi->bibitcount;  
       
            if   (ncolors   >   256)  
                  ncolors   =   0;  
            hdr.bftype   =   ((word)   (m   <<   8)   |   b);   //   is   always   "bm"  
            hdr.bfsize   =/*   globalsize   (hdib)   +   */sizeof(   hdr   );  
            hdr.bfsize   =   size   +   sizeof(   hdr   );  
            hdr.bfreserved1   =   0;  
            hdr.bfreserved2   =   0;  
            hdr.bfoffbits   =   (dword)   (sizeof(   hdr   )   +   lpbi->bisize   +  
            ncolors   *   sizeof(rgbquad));   //   write   the   file   header  
       
            fwrite(&hdr,   1,   sizeof(hdr),file);   //   write   the   dib   header   and   the   bits  
            fwrite(lpbi,   1,   size   ,file);  
       
            fclose(file);  
            return   true;  
      }  
     

    网友:jishiping

    用timage的话,直接用image->picture->loadfromfile(bmpfilename);就可以显示了。

    .

    讨论区

    Login