// 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
c 语言读取BMP格式文件源代码
最新推荐文章于 2021-05-20 11:36:34 发布