资源简介
This program is designed specifically for reading 24bit Bitmap, other bitmap varying the bits per pixel needs altering.
The structure's detailed information can be found at Wikipedia's BMP file format entry.
代码片段和文件信息
/*
Author:limitfan@gmail.com
Date:4/15/2011
This program is designed specifically for reading 24bit Bitmap other bitmap varying the bits per pixel needs altering.
The structure‘s detailed information can be found at Wikipedia‘s BMP file format entry.
*/
#include
#define uint8 unsigned char
#define uint16 unsigned short
#define uint32 unsigned int
//Define the structure for Bitmap file header:14 Bytes;
#pragma pack(1)
typedef struct{
uint16 type;
uint32 size;
uint16 reserved1;
uint16 reserved2;
uint32 offset;
}BITMAPFILEHEADER;
#pragma pack(0)
//Define the structure for Bitmap info header:40 Bytes;
#pragma pack(1)
typedef struct{
uint32 size;
uint32 width;
uint32 height;
uint16 planes;
uint16 bitcount;
uint32 compression;
uint32 sizeImage;
uint32 xpxl;
uint32 ypxl;
uint32 clrUsed;
uint32 clrImportant;
}BITMAPINFOHEADER;
#pragma pack(0)
#pragma pack(1)
typedef struct{
uint8 b;
uint8 g;
uint8 r;
}RGB;
#pragma pack(0)
BITMAPFILEHEADER fileHeader;
BITMAPINFOHEADER infoHeader;
RGB rgb[100005];
int main(){
printf(“yoshi! start!\n“);
// printf(“%d\n“sizeof(BITMAPFILEHEADER));
// printf(“%d\n“sizeof(BITMAPINFOHEADER));
// printf(“%d\n“sizeof(RGB))
- 上一篇:朴素贝叶斯算法C语言实现,来自网络
- 下一篇:MFC_带进度条的状态栏
相关资源
- 基于MFC的TCP调试助手源码95706
- 国际象棋的qt源代码
- 操作系统c语言模拟文件管理系统844
- C语言开发实战宝典
- C++中头文件与源文件的作用详解
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- C语言代码高亮html输出工具
- 猜数字游戏 c语言代码
- C语言课程设计
- 数字电位器C语言程序
- CCS FFT c语言算法
- 使用C语言编写的病房管理系统
- 通信过程中的RS编译码程序(c语言)
- 利用C++哈希表的方法实现电话号码查
- 计算机二级C语言上机填空,改错,编
- 用回溯法解决八皇后问题C语言实现
- 移木块游戏,可以自编自玩,vc6.0编写
- 简易教务管理系统c语言开发文档
- 操作系统课设 读写者问题 c语言实现
- 小波变换算法 c语言版
- C流程图生成器,用C语言代码 生成C语
- 3des加密算法C语言实现
- 简单的C语言点对点聊天程序
- 单片机c语言源程序(51定时器 八个按
- C++纯文字DOS超小RPG游戏
- 个人日常财务管理系统(C语言)
- MFC数字钟(基于VC6.0)
- c语言电子商务系统
评论
共有 条评论