Beispiel #1
0
void Draw::drawAPicture(pos x, pos y, short int width, short int height,
	char tp[], short int color)
{
	char temp;
	int x0 = x;
	myGLCD.setColor(color);
	int wid = width / 8;
	//将二进制中为一的表示为该点位亮。
	//将tp[]中的数据依次点亮屏幕。
	for (int i = 0; i < height; i++){

		for (int j = 0; j < width; j++){

			if (j % 8 == 0)temp = tp[i*wid + j / 8];
			if (temp & 0x80){
				myGLCD.drawPixel(x0, y);
			}
			temp <<= 1;
			x0++;
		}
		x0 = x;
		y++;
	}
}