亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? bitmap.h

?? Tic tac toe is (exactly what re your thinking) and it s the first game I made. Made it in one whole
?? H
字號(hào):
/*

						Date of release: 21/5/2003


		Microsoft(R) Windows(R) 1-bit(monochrome) and 4-bit(16 color)

							 Bitmap Reader

							 Version 2.00

								By Yas

						realyas2001@hotmail.com

							SZABIST Karachi

								PAKISTAN



		This is the header file used to display Microsoft(R) Windows(R) 1-bit
	(2 color also known as monochrome) and 4-bit(16 color) bitmap files in C
	language with the help of EGAVGA.BGI driver. This code has been compiled
	with the Borland Turbo C++ v3.0.



	NOTE:
		The code is a freeware only for evaluation purposes. If you wish to
	use it commertially than contact the author.


	The bitmap reader is a library header file which has the ability to display
1-bit(monochrome or 2 color) and 4-bit(16 color) images in C language. This
library has been written on the Borland Turbo C++ v3.0 .

	All the limitations reguarding the bitmaps are removerd in this version.

	The limitations removed are as follows:

1)  Various programmers had a problem displaying bitmaps(Even I did although I
	had traced the error in my previous version) properly i.e. the width of the
	bitmap had to be calculated using an error correction. This calculation is
	fully corrected and now bitmaps of any resolution can be displayed thus now
	the width of the bitmap does not have to be a multiple of 8. It can be of
	any width and height.

2)  Better control over the function which displays the bitmap is given.

3)  More technical help is given which will help to learn how the code works.




	The only problem faced now is that one of the colors is not displayed correctly
	in the bitmap.



	NEXT TARGET:

		My next target is to add compression algorigthm(Run Length Encoding)
		in the bitmap reader.

*/



#ifndef __BITMAP_H
#define __BITMAP_H

#ifndef __STDIO_H
#include<stdio.h>
#endif

#ifndef __GRAPHICS_H
#include<graphics.h>
#endif

#ifndef FILE_READING_ERROR
#define FILE_READING_ERROR 255
#endif

#ifndef BM_FILE_ERROR
#define BM_FILE_ERROR 254
#endif

#ifndef BM_FILE_ERROR
#define BM_FILE_ERROR 253
#endif

#ifndef COMPRESSION_ERROR
#define COMPRESSION_ERROR 252
#endif

#ifndef BITS_PER_PIXEL_ERROR
#define BITS_PER_PIXEL_ERROR 251
#endif

#ifndef FILE_HEADER_READING_ERROR
#define FILE_HEADER_READING_ERROR 250
#endif

#ifndef INFO_HEADER_READING_ERROR
#define INFO_HEADER_READING_ERROR 249
#endif




/* These two following structures are the Microsoft(R) Windows(R) 3.x bitmap

	structures:




   The Bitmap File Header */

typedef struct
{
	unsigned char type[2];  /* This specifies the type of file. This should be
									equal to BM */
	unsigned long file_size;  /* This gives the bitmap size in bytes */
	unsigned int reserved_1;  /* This is reserved and must be 0 */
	unsigned int reserved_2;  /* This is also reserved and must also be 0 */
	unsigned long offset;  /* This specifies the number of bytes from the
								starting of the bitmap to where the actual
								data part starts */
}BITMAP_FILE_HEADER;


/* The Bitmap Information Header */

typedef struct
{
	unsigned long structure_size;  /* This specifies in bytes the size of the
									header. This must be equal to 40. */
	long width;  /* This specifies the width of bitmap in pixels */
	long height;  /* This specifies the height of bitmap in pixels */
	unsigned int number_of_color_planes;  /* This specifies the number of
											color planes */
	unsigned int bits_per_pixel;  /* This specifies the bits per pixel i.e.
									the total number of colors in the bitmap */
	unsigned long compression;  /* This specifies the type of RLE compression in
								the bitmap. No compression means that the
								value will be 0. */
	unsigned long image_size;  /* This specifies the size of image in pixels
								i.e. width x height */
	long horizontal_pixels_per_meter;  /* This specifies the horizontal
											resolution of image as pixels per
											meter */
	long vertical_pixels_per_meter;  /* This specifies the vertical resolution
										of image as pixels per meter */
	unsigned long colors_used;  /* This specifies the colors used in the
									bitmap. For 4-bit image this value is 0 */
	unsigned long important_colors;  /* This specifies the minimum number of
										important colors in the bitmap */
}BITMAP_INFORMATION_HEADER;



/*	Since the colors are read as EGA colors therefore the colors must be
	converted into their respective VGA colors and so that the colors
	could be displayed as they are present in the bitmap. This is because
	the colors in a bitmap are stored in the form of EGA color palette.

	NOTE: There is one color in Microsoft's(R) EGA palette which is different
	from the one present with the palette given with the EGAVGA driver so it
	will always be displayed as an alternate color. */

unsigned char ega2vga(unsigned char color)
{
	switch(color)
	{
		case 11:
			return(YELLOW);

		case 14:
			return(LIGHTCYAN);

		case 12:
			return(LIGHTBLUE);

		case 1:
			return(RED);

		case 9:
			return(LIGHTRED);

		case 3:
			return(BROWN);

		case 4:
			return(BLUE);

		case 6:
			return(CYAN);

		case 7:
			return(DARKGRAY);

		case 8:
			return(LIGHTGRAY);

	}
	return(color);
}


/*	When reading the monochrome bitmaps the colors must be converted to their
	respective colors for the VGA driver */

unsigned char monochrome2vga(unsigned char color)
{
	if(color==1)
		return(WHITE);
	return(color);
}



unsigned char displaybitmap(int x,int y,unsigned char *file_name)
{
	FILE *bitmap_file;
	BITMAP_FILE_HEADER bitmap_header;
	BITMAP_INFORMATION_HEADER bitmap_information;
	int screen_x,screen_y;
	unsigned int check=0;
	unsigned char color,pixel_color,correction,type;

	if((bitmap_file=fopen(file_name,"rb"))==NULL) /* Opening bitmap file in
												read-only mode */
		return(FILE_READING_ERROR);

	/* Reading the bitmap file header */
	if(fread(&bitmap_header,sizeof(BITMAP_FILE_HEADER),1,bitmap_file)!=1)
		return(FILE_HEADER_READING_ERROR);

	/* Reading the bitmap information header */
	if(fread(&bitmap_information,sizeof(BITMAP_INFORMATION_HEADER),1,bitmap_file)!=1)
		return(INFO_HEADER_READING_ERROR);

	if((bitmap_header.type[0]!='B')||(bitmap_header.type[1]!='M'))
									/* Checking whether the file is a bitmap
									file i.e. checking if it is BM(BitMap) */
	{
		fclose(bitmap_file);
		return(BM_FILE_ERROR);
	}

	if(bitmap_information.compression!=0) 	/* Checking whether there is a
											RLE compression or not because
											this code does not support RLE
											compression */
	{
		fclose(bitmap_file);
		return(COMPRESSION_ERROR);
	}

	fseek(bitmap_file,bitmap_header.offset,SEEK_SET);
	/* Setting the file pointer to the offset part, where the actual data of
		the bitmap starts */


	if(bitmap_information.bits_per_pixel==1) /* Checking whether the bitamp is
												a 1-bit(monochrome) bitamp */
	{

		/* This is an error correction so that images of different resolution
		can be displayed. This correction has to be checked for every bitmap */
		correction=bitmap_information.width%32;
		if(correction!=0)
			correction=32-correction;

		/* Now there is one more issue that the bitmap must be read from the
			left bottom to right top so we are going to do exactly that. */
		for(screen_y=y+bitmap_information.height-1;screen_y>y-1;screen_y--)
		{
			for(screen_x=x;screen_x<x+bitmap_information.width+correction;screen_x++)
			{

				/* The data in the bitamp is stored in such a way theat each
				pixel will give its color value.

				Reading one byte of color data.

				NOTE: One byte of color data will contain eight bits of color
				values and these values must be displayed individually */
				pixel_color=fgetc(bitmap_file);

				if(++check<=bitmap_information.width)
					/* Displaying the first color data */
					putpixel(screen_x,screen_y,monochrome2vga(pixel_color>>7));

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the second color data */
					color=pixel_color<<1;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)

				{
					/* Displaying the third color data */
					color=pixel_color<<2;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the forth color data */
					color=pixel_color<<3;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the fifth color data */
					color=pixel_color<<4;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the sixth color data */
					color=pixel_color<<5;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the seventh color data */
					color=pixel_color<<6;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

				screen_x++;

				if(++check<=bitmap_information.width)
				{
					/* Displaying the eighth color data */
					color=pixel_color<<7;
					putpixel(screen_x,screen_y,monochrome2vga(color>>7));
				}

			}
			check=0;
		}
		type=1;
	}
	else
		if(bitmap_information.bits_per_pixel==4)  /* Checking whether the
												bitmap is a 4-bit(16 color)
												bitmap file */
		{

			correction=bitmap_information.width%8;
			if(correction!=0)
				correction=8-correction;

			/* Reading the bitmap from left bottom to right top */
			for(screen_y=y+bitmap_information.height-1;screen_y>y-1;screen_y--)
			{
				for(screen_x=x;screen_x<x+bitmap_information.width+correction;screen_x++)
				{
					/*	The data of the bitmap is stored in such a way
						that each pixel will give its color.

						NOTE: Since in the bitmap each color data is written
						in the form of a nibble(half of a byte) and we are
						reading the data in the form of a byte therefore the
						function will read exactly two color data and we are
						are going to have to get the two color data and use it
						seperatly to display each pixel.


						Reading one byte of color data. */
					pixel_color=fgetc(bitmap_file);

					if(++check<=bitmap_information.width)

						/* Displaying the first color data */
						putpixel(screen_x,screen_y,ega2vga(pixel_color>>4));

					screen_x++;

					if(++check<=bitmap_information.width)
					{
						/* Displaying the second color data */
						color=pixel_color<<4;
						putpixel(screen_x,screen_y,ega2vga(color>>4));
					}
				}
				check=0;
			}
			type=4;
		}
		else

		/* If the bitmap is not a 1-bit or a 4-bit image then an error message
		will be displayed */
		{
			fclose(bitmap_file);
			return(BITS_PER_PIXEL_ERROR);
		}

	/* Closing the bitmap file */
	fclose(bitmap_file);
	return(type);
}


/* End of macro defination __BITMAP_H */
#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品激情偷乱一区二区∴| 欧美精品v国产精品v日韩精品 | 91精品国产91热久久久做人人| 中文字幕一区二区三区精华液 | 久久婷婷国产综合精品青草 | 欧美国产成人精品| 成人av网址在线| **欧美大码日韩| 欧美日韩国产天堂| 卡一卡二国产精品 | 91精品1区2区| 水蜜桃久久夜色精品一区的特点| 欧美一区二区在线不卡| 精品一区二区三区日韩| 国产精品视频一二三| 在线免费观看日本一区| 日韩av不卡在线观看| 久久精品夜色噜噜亚洲aⅴ| 99re热这里只有精品视频| 亚洲一区在线看| 精品免费国产一区二区三区四区| 国产成人激情av| 一级女性全黄久久生活片免费| 91精品婷婷国产综合久久| 国产米奇在线777精品观看| 成人欧美一区二区三区黑人麻豆 | 精品国产1区二区| 99久久99久久综合| 日韩二区在线观看| 亚洲国产成人私人影院tom| 欧美三级视频在线| 韩国视频一区二区| 一区二区高清在线| 久久久久久97三级| 欧美喷水一区二区| 成人av在线资源| 日韩avvvv在线播放| 日韩毛片在线免费观看| 日韩视频123| 色婷婷综合久久久中文一区二区| 久久国产乱子精品免费女| 亚洲欧美电影一区二区| 久久在线观看免费| 欧美日韩免费高清一区色橹橹| 国产丶欧美丶日本不卡视频| 亚洲成人黄色小说| 亚洲婷婷综合久久一本伊一区 | 国产一区二区免费在线| 亚洲国产另类av| 中文字幕中文在线不卡住| 日韩欧美激情一区| 欧美午夜片在线观看| 成人免费高清在线观看| 狠狠色丁香久久婷婷综| 日本成人在线网站| 亚洲成va人在线观看| 亚洲日本免费电影| 一区在线中文字幕| 久久精品人人做人人爽人人| 日韩一本二本av| 欧美群妇大交群中文字幕| 欧美影院午夜播放| 色婷婷精品久久二区二区蜜臀av| 成人美女在线观看| 粉嫩一区二区三区在线看| 国产精品主播直播| 韩国午夜理伦三级不卡影院| 麻豆精品新av中文字幕| 日本美女一区二区| 日韩av电影天堂| 琪琪久久久久日韩精品| 偷拍日韩校园综合在线| 亚洲成人激情社区| 手机精品视频在线观看| 日韩一区欧美二区| 亚洲成人动漫一区| 午夜精品久久久久| 日本不卡高清视频| 精品亚洲免费视频| 国产精品亚洲第一区在线暖暖韩国 | 在线观看一区日韩| 在线观看日韩毛片| 欧美日韩国产一二三| 欧美精品一级二级| 日韩一区二区电影网| 精品日韩av一区二区| 久久蜜桃av一区二区天堂| 欧美国产亚洲另类动漫| 国产精品另类一区| 亚洲欧美一区二区三区国产精品| 亚洲女人的天堂| 亚洲一级片在线观看| 日本va欧美va欧美va精品| 久久精品国产久精国产| 国产一区欧美日韩| 播五月开心婷婷综合| 色婷婷精品大在线视频| 制服丝袜亚洲精品中文字幕| 日韩女优av电影在线观看| 国产欧美一区二区精品性色超碰 | 国产主播一区二区三区| 成人激情文学综合网| 色吧成人激情小说| 7777精品伊人久久久大香线蕉的| 日韩精品在线一区二区| 中文字幕欧美日本乱码一线二线| 亚洲免费观看在线视频| 日韩精品亚洲专区| 成人av综合一区| 7777精品伊人久久久大香线蕉超级流畅 | 欧美偷拍一区二区| 精品国产在天天线2019| 中文字幕乱码久久午夜不卡| 一区二区三区日本| 极品美女销魂一区二区三区免费| 波多野结衣亚洲| 91麻豆精品国产自产在线| 久久久精品tv| 亚洲va天堂va国产va久| 国产精品一区二区在线播放| 色88888久久久久久影院野外| 日韩欧美一区在线| 最近日韩中文字幕| 热久久国产精品| 91一区二区在线| 欧美mv日韩mv国产网站| 亚洲三级电影网站| 国内一区二区视频| 欧美亚洲国产一区在线观看网站| 精品国产免费一区二区三区四区| 亚洲精品国产精华液| 国产精品一区二区三区网站| 欧美日韩电影一区| 中文字幕一区二区在线播放 | 国产午夜精品福利| 日韩高清不卡在线| 在线观看免费视频综合| 久久毛片高清国产| 老司机一区二区| 欧美性生活久久| 国产精品免费aⅴ片在线观看| 男人操女人的视频在线观看欧美 | 成人免费毛片嘿嘿连载视频| 91精品国产一区二区三区蜜臀 | 亚洲免费av网站| 国产成人午夜视频| 日韩美一区二区三区| 午夜激情久久久| 91成人网在线| 国产精品国产自产拍高清av| 国产一区二区不卡| 精品久久人人做人人爽| 日一区二区三区| 欧美日产国产精品| 夜夜夜精品看看| 色综合久久久久综合| 国产精品毛片大码女人| 国产大陆a不卡| 国产午夜精品久久| 国产精品亚洲а∨天堂免在线| 精品免费99久久| 国产又黄又大久久| 26uuu亚洲| 国产真实精品久久二三区| 欧美成人精品高清在线播放 | 国产亚洲欧美一区在线观看| 麻豆一区二区三| 欧美成人精品福利| 日韩黄色片在线观看| 欧美一区二区女人| 精东粉嫩av免费一区二区三区| 正在播放亚洲一区| 九九视频精品免费| 2023国产精华国产精品| 国产精品88av| 亚洲国产高清在线| 97久久精品人人做人人爽50路| 综合在线观看色| 一本大道av伊人久久综合| 一区二区三区小说| 欧美日韩激情一区二区三区| 日韩高清国产一区在线| 精品国产乱码久久久久久夜甘婷婷| 精品一区二区三区av| 久久精品一区二区三区不卡| 99久久99久久久精品齐齐| 亚洲综合色成人| 日韩午夜在线观看视频| 国产成人精品1024| 亚洲综合自拍偷拍| 91精品国产aⅴ一区二区| 国产精品888| 亚洲免费观看高清完整版在线观看熊 | 国产日韩在线不卡| 色综合天天综合网国产成人综合天| 亚洲综合成人在线| 日韩三级电影网址| 成人免费高清在线| 亚洲成人免费看| 国产亚洲视频系列|