用c语言读取并显示bmp图像1.doc

用c语言读取并显示bmp图像1.doc

ID:62048848

大小:81.50 KB

页数:26页

时间:2021-04-16

用c语言读取并显示bmp图像1.doc_第1页
用c语言读取并显示bmp图像1.doc_第2页
用c语言读取并显示bmp图像1.doc_第3页
用c语言读取并显示bmp图像1.doc_第4页
用c语言读取并显示bmp图像1.doc_第5页
资源描述:

《用c语言读取并显示bmp图像1.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、个人收集整理勿做商业用途如何在WIN-TC中或TC++3.0中把一张BMP格式的图片显示出来?下面的是<<C& C++编程实例>>随书光盘上的代码,我在TC2.0下编译通过.它是利用了抖动技术显示了8bit和24bit的位图(也就是256色和16M色位图),应该能满足你的需要.不过,我想问下,你老师教过抖动显示吗? ﻫ#include#include<dos.h>ﻫ#include<stdio.h>#include <conio.h> ﻫﻫ#defineNoError 0 #defineErrorFileOpen1ﻫ#defineErrorFileType2

2、ﻫ#define ErrorImageColor3ﻫﻫtypedef structtagBITMAPFILEHEADER{ﻫunsignedint bfType;ﻫunsigned longbfSize;ﻫunsigned intbfReserved1; unsignedintbfReserved2;unsignedlong bfoffBits;}BITMAPFILEHEADER;ﻫtypedef structtagBITMAPINFOHEADER ﻫ{unsignedlongbiSize;unsignedlongbiWidth; unsignedlongbiHeight;ﻫ

3、unsigned int biPlanes;unsignedintbiBitCount;unsignedlongbiCompression;ﻫunsignedlongbiSizeImage;unsigned longbiXPelsPerMeter;ﻫunsignedlongbiYPelsPerMeter;unsignedlong biClrUsed;unsignedlongbiClrImportant;}BITMAPINFOHEADER;ﻫtypedefstructtagRGBQUADﻫ{ ﻫunsignedchar rgbBlue; unsignedchar rgbGree

4、n; unsigned charrgbRed; ﻫunsignedcharrgbReserved;ﻫ} RGBQUAD;ﻫunsignedcharPalReg[17]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}; unsignedcharStandardPal[48]= {ﻫ0,0,0,32, 0, 0,0,32,0,32,32,0,0,0,32,32,0,32,0,32,32,32,32, 32,48,48,48, 63,0,0,0,63,0,63,63,0,0, 0,63,63, 0,63,0,63,63,63,63,63,}; ﻫ

5、unsignedcharLightnessMatrix[16][16]= {{0,235,59,219,15,231,55,215,2,232,56,217,12,229,52,213},ﻫ{128,64,187,123,143,79,183,119,130,66,184,120,140,76,180,116},{33,192,16,251,47,207,31,247,34,194,18,248,44,204,28,244},{161,97,144,80,175,111,159,95,162,98,146,82,172,108,156,92}, {8,225,48,208,5

6、,239,63,223,10,226,50,210,6,236,60,220},ﻫ{136,72,176,112,133,69,191,127,138,74,178,114,134,70,188,124}, ﻫ{41,200,24,240,36,197,20,255,42,202,26,242,38,198,22,252}, {169,105,152,88,164,100,148,84,170,106,154,90,166,102,150,86},ﻫ{3,233,57,216,13,228,53,212,1,234,58,218,14,230,54,214},ﻫ{131,67

7、,185,121,141,77,181,117,129,65,186,122,142,78,182,118},个人收集整理勿做商业用途{35,195,19,249,45,205,29,245,32,193,17,250,46,206,30,246},ﻫ{163,99,147,83,173,109,157,93,160,96,145,81,174,110,158,94},{11,227,51,211,7,237,61,221,9,224,49,209,4,238,62,222},{139,75,179,1

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。