- 1、本文档共38页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
如何在WIN-TC中或TC++3.0中把一张BMP格式的图片显示出来?下面的是C C++编程实例随书光盘上的代码,我在TC2.0下编译通过. 它是利用了抖动技术显示了8bit和24bit的位图(也就是256色和16M色位图),应该能满足你的需要. 不过,我想问下,你老师教过抖动显示吗? #include stdio.h #include dos.h #include stdio.h #include conio.h #define NoError 0 #define ErrorFileOpen 1 #define ErrorFileType 2 #define ErrorImageColor 3 typedef struct tagBITMAPFILEHEADER { unsigned int bfType; unsigned long bfSize; unsigned int bfReserved1; unsigned int bfReserved2; unsigned long bfoffBits; }BITMAPFILEHEADER; typedef struct tagBITMAPINFOHEADER { unsigned long biSize; unsigned long biWidth; unsigned long biHeight; unsigned int biPlanes; unsigned int biBitCount; unsigned long biCompression; unsigned long biSizeImage; unsigned long biXPelsPerMeter; unsigned long biYPelsPerMeter; unsigned long biClrUsed; unsigned long biClrImportant; } BITMAPINFOHEADER; typedef struct tagRGBQUAD { unsigned char rgbBlue; unsigned char rgbGreen; unsigned char rgbRed; unsigned char rgbReserved; } RGBQUAD; unsigned char PalReg[17]= { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}; unsigned char StandardPal[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, }; unsigned char LightnessMatrix [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,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,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,
文档评论(0)