• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >嵌入式开发 > 请达人解答用C语言处理BMP图象的问题!急!

请达人解答用C语言处理BMP图象的问题!急!

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-06-05

佚名通过本文主要向大家介绍了bmp图象,丽羊羊怀孕的图象,qq图象,中国图象图形学报,图象等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 请达人解答用C语言处理BMP图象的问题!急!
描述:

我纯C编程,想处理一下BMP图象。我把图象的文件头读入看了看数据。结果BITMAPINFOHEADER结构里的
各个参数的数据都不对了。我用int或long int存储的
比如:
biSize是3558867(书上说是40),
biWidth是2621440,
biHeight是419443040,
biSizeImage是268435456,
biBitCount是65536(书上说是1,2,4,8,16,24中的一个数)
biXpelspermeter是258015246,
biYpelspermeter是256015232
这么数据都这么大,我都没法操作,而且和书上所说的都差很多
请C达人指导一下,为什么会这样啊。先谢啦!


解决方案1:

typedef struct tagBITMAPINFOHEADER{
  DWORD  biSize; 
  LONG   biWidth; 
  LONG   biHeight; 
  WORD   biPlanes; 
  WORD   biBitCount; 
  DWORD  biCompression; 
  DWORD  biSizeImage; 
  LONG   biXPelsPerMeter; 
  LONG   biYPelsPerMeter; 
  DWORD  biClrUsed; 
  DWORD  biClrImportant; 
} BITMAPINFOHEADER, *PBITMAPINFOHEADER; 

解决方案2:

biSize 
Specifies the number of bytes required by the structure. 
biWidth 
Specifies the width of the bitmap, in pixels. 
Windows 98/Me, Windows 2000/XP: If biCompression is BI_JPEG or BI_PNG, the biWidth member specifies the width of the decompressed JPEG or PNG image file, respectively. 
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. 
Windows 98/Me, Windows 2000/XP: If biCompression is BI_JPEG or BI_PNG, the biHeight member specifies the height of the decompressed JPEG or PNG image file, respectively. 
biPlanes 
Specifies the number of planes for the target device. This value must be set to 1. 
biBitCount 
Specifies the number of bits-per-pixel. The biBitCount member of the BITMAPINFOHEADER structure determines the number of bits that define each pixel and the maximum number of colors in the bitmap. This member must be one of the following values. 
biCompression 
Specifies the type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed). This member can be one of the following values. 
biSizeImage 
Specifies the size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps. 
Windows 98/Me, Windows 2000/XP: If biCompression is BI_JPEG or BI_PNG, biSizeImage indicates the size of the JPEG or PNG image buffer, respectively. 
biXPelsPerMeter 
Specifies the horizontal resolution, in pixels-per-meter, of the target device for the bitmap. An application can use this value to select a bitmap from a resource group that best matches the characteristics of the current device. 
biYPelsPerMeter 
Specifies the vertical resolution, in pixels-per-meter, of the target device for the bitmap. 
biClrUsed 
Specifies the number of color indexes in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression. 
If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. If biBitCount is 16 or greater, the biClrUsed member specifies the size of the color table used to optimize performance of the system color palettes. If biBitCount equals 16 or 32, the optimal color palette starts immediately following the three DWORD masks. 
When the bitmap array immediately follows the BITMAPINFO structure, it is a packed bitmap. Packed bitmaps are referenced by a single pointer. Packed bitmaps require that the biClrUsed member must be either zero or the actual size of the color table. 
biClrImportant 
Specifies the number of color indexes that are required for displaying the bitmap. If this value is zero, all colors are required. 


分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 请达人解答用C语言处理BMP图象的问题!急!

相关文章

  • 2017-06-05 将2k下的虚网卡驱动移植到98下的问题!急!
  • 2017-06-05 新手,请各位指教
  • 2017-06-05 一个关于无线路由的问题
  • 2017-06-05 关于循迹小车的问题
  • 2017-06-05 请问哪里有最新WINDOWS2000DDK下载?谢谢!
  • 2017-06-05 你知道GSP2e/LP-7451吗
  • 2017-06-05 在基于linux30的arm_a9中移植mt9m001cmossensor
  • 2017-06-05 驱动故障,请各位高手进来指点,谢谢!!急!!!!
  • 2017-06-05 oled液晶显示有覆盖现象,代码应该怎么改一下呢?
  • 2017-06-17ARM流水线技术

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • lua.dlllua函数条件与返回的区别是什么?
    • 我手里有一块飞凌嵌入式的iMX6开发板,开机默认语言怎么更改为英文
    • stm32按键电路设计问题
    • vxworksbin格式映像文件加载问题
    • 我制作了centOS65的Upan启动盘,从u盘启动没反应?
    • DVR中通道号是什么意思?
    • 水位检测,电路实现
    • 需要用并口模拟脉冲信号来驱动步进电机
    • ARM指令的寻址方式
    • PIC24FJ64GA306读写24LC512其他时地址0x00-0x03的数据被修改

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有