免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: kellenforever
打印 上一主题 下一主题

打开图像文件,提示内存不足????? [复制链接]

论坛徽章:
0
11 [报告]
发表于 2011-04-18 11:17 |只看该作者
回复 10# nizvoo

#define WIDTHBYTE(bits)        ((bits+31)/32*4)
    数组是定义好的。  
   LPBYTE *pData;                                                            //pData为存储图像数据
    pData=new LPBYTE[pBMIH->biHeight];                        //pBMIH 为图像的信息头
   int nWidhtBytes=WIDTHBYTE(pBMIH->biBitCount*(pBMIH->biWidth))
     for(int i=0;i<pBMIH->biHeight;i++)
    {
       pData=new BYTE[nWidthBytes];
      .............;
   }

论坛徽章:
324
射手座
日期:2013-08-23 12:04:38射手座
日期:2013-08-23 16:18:12未羊
日期:2013-08-30 14:33:15水瓶座
日期:2013-09-02 16:44:31摩羯座
日期:2013-09-25 09:33:52双子座
日期:2013-09-26 12:21:10金牛座
日期:2013-10-14 09:08:49申猴
日期:2013-10-16 13:09:43子鼠
日期:2013-10-17 23:23:19射手座
日期:2013-10-18 13:00:27金牛座
日期:2013-10-18 15:47:57午马
日期:2013-10-18 21:43:38
12 [报告]
发表于 2011-04-18 11:57 |只看该作者
回复  nizvoo

#define WIDTHBYTE(bits)        ((bits+31)/32*4)
    数组是定义好的。  
   LPBYTE  ...
kellenforever 发表于 2011-04-18 11:17




    biHeight
Specifies the height of the bitmap, in pixels. If biHeight is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If biHeight is negative, the bitmap is a top-down DIB and its origin is the upper-left corner.
If biHeight is negative, indicating a top-down DIB, biCompression must be either BI_RGB or BI_BITFIELDS. Top-down DIBs cannot be compressed.

看看你的biHeight是否负数

论坛徽章:
0
13 [报告]
发表于 2011-04-18 19:24 |只看该作者
回复 12# hellioncu


    我在载入图像文件时,已经abs(m_pBMIH->biHeight )了。而且文件小一点的话是可以打开的,就是大一些的话就提示"内存不足"
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP