c 语言读取BMP格式文件源代码

// PrintBMPPixel.c
// c 语言读取BMP格式文件源代码
// 可同时处理没有压缩的BMP格式的二值图像, 索引图像, 真彩色图像。

#include <stdio.h>
#include <Windows.h>
 // 位图文件头
typedef struct tagBMPFILEHEADER
{
	unsigned short bfType;     // 2 bytes
	unsigned long bfSize;	   // 4 bytes
	WORD bfReserved1;			// 2 bytes
	WORD bfReserved2;			// 2 bytes
	unsigned long bfOffBits;    // 4 bytes
}BMPHEADER;

BMPHEADER bmpheader;

// 位图信息头
typedef struct tagBMPINFOHEADER
{
	DWORD  biSize;
	LONG  biWidth;
	LONG  biHeight;
	WORD  biPlanes;
	WORD biBitCount;
	DWORD biCompression;
	DWORD biSizeImage;
	LONG biXPelsPerMeter;
	LONG biYPelsPerMeter;
	DWORD biclrUsed;
	DWORD biClrImportant;
}BMPINFOHEADER;

BMPINFOHEADER bmpinfoheader;

// 调色板(可选)

typedef struct tagBMPRGBQUAD
{
	BYTE rgbBlue;   // typedef unsigned char BYTE 
	BYTE rgbGreen;
	BYTE rgbRed;
	BYTE rgbRese
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
数字图像获取处理及实践应用源代码\ImageProcessing\cdib.cpp ................................\...............\cdib.h ................................\...............\ChildFrm.cpp ................................\...............\ChildFrm.h ................................\...............\ColorTable.h ................................\...............\Default.SUP ................................\...............\DIBPrcs.cpp ................................\...............\DibShow.cpp ................................\...............\DlgAftReg.cpp ................................\...............\DlgAftReg.h ................................\...............\DlgArith.cpp ................................\...............\DlgBitPlane.cpp ................................\...............\DlgCoding.h ................................\...............\DlgCodingHuffman.cpp ................................\...............\DlgEhnLinTrans.cpp ................................\...............\DlgEhnLinTrans.h ................................\...............\DlgEnhColor.cpp ................................\...............\DlgEnhColor.h ................................\...............\DlgHistShow.cpp ................................\...............\DlgHistShow.h ................................\...............\DlgHistShow1.cpp ................................\...............\DlgHistShow1.h ................................\...............\DlgHuffman.cpp ................................\...............\DlgMedian.cpp ................................\...............\DlgMedian.h ................................\...............\DlgRecMatch.cpp ................................\...............\DlgRecMatch.h ................................\...............\DlgReg.cpp ................................\...............\DlgReg.h ................................\...............\DlgShannon.cpp ................................\...............\DlgSmooth.cpp ................................\...............\DlgSmooth.h ................................\...............\DWT.CPP ................................\...............\Enhance.cpp ................................\...............\FreTrans.cpp ................................\...............\GlobalApi.h ................................\...............\ImageAnalysis.cpp ................................\...............\ImageCoding.cpp ................................\...............\ImageProcessing.aps ................................\...............\ImageProcessing.clw ................................\...............\ImageProcessing.cpp ................................\...............\ImageProcessing.dsp ................................\...............\ImageProcessing.dsw ................................\...............\ImageProcessing.h ................................\...............\ImageProcessing.ncb ................................\...............\ImageProcessing.opt ................................\...............\ImageProcessing.plg ................................\...............\ImageProcessing.rc ................................\...............\ImageProcessingDoc.cpp ................................\...............\ImageProcessingDoc.h ................................\...............\ImageProcessingView.cpp ................................\...............\ImageProcessingView.h ................................\...............\ImageView.cpp ................................\...............\MainFrm.cpp ................................\...............\MainFrm.h ................................\...............\Motion.cpp ................................\...............\ReadMe.txt ................................\...............\Recog.asp ................................\...............\Recog.cpp ................................\...............\res\ImageProcessing.ico ................................\...............\...\ImageProcessing.rc2 ................................\...............\...\ImageProcessingDoc.ico ................................\...............\...\Toolbar.bmp ................................\...............\resource.h ................................\...............\restore.cpp ................................\...............\SegApi.cpp ................................\...............\StdAfx.cpp ................................\...............\StdAfx.h ................................\lena.bmp ................................\ImageProcessing\Debug ................................\...............\Release ................................\...............\res ................................\ImageProcessing

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值