源码:
/*
@func void | DisplayPicture | Show the Picture in the LCD.
@rdesc x ---> the x postion to show in the LCD
@ y ---> the y postion to show in the LCD
@comm
@xref
*/
static void DisplayPicture(unsigned char X, unsigned char Y)
{
unsigned int i,j,iTFT,jTFT,iBMP,jBMP;
//unsigned short *pDisplayAddress = (unsigned short*)(IMAGE_FRAMEBUFFER_UA_BASE + (LCD_XSIZE_TFT*2*(Y-1) + 2*X));
unsigned short *pDisplayAddress = (unsigned short*)(IMAGE_FRAMEBUFFER_UA_BASE);
memset((void *)IMAGE_FRAMEBUFFER_UA_BASE, BACKGROUND_COLOR, LCD_ARRAY_SIZE_TFT_16BIT); /*White */
#if (LCD_TYPE == TFT240_320)
for(i=0;i < LCD_XSIZE_TFT * LCD_YSIZE_TFT;i++)
{
unsigned short colorTemp;
colorTemp = ScreenBitmap[i];
*pDisplayAddress = Palette[colorTemp];
pDisplayAddress++;
}
#else
//#elif (LCD_TYPE == TFT480_272)
//#elif (LCD_TYPE == TFT640_480)
//#elif (LCD_TYPE == TFT800_480)
//#elif (LCD_TYPE == TFT800_600)
jTFT = (LCD_YSIZE_TFT - BMP_Y_SIZE)/2,jBMP = 0;
for(;jTFT < (LCD_YSIZE_TFT + BMP_Y_SIZE)/2 && jBMP < BMP_Y_SIZE;jTFT ++,jBMP++)
{
iTFT = (LCD_XSIZE_TFT - BMP_X_SIZE)/2,iBMP = 0;
for(;iTFT < (LCD_XSIZE_TFT + BMP_X_SIZE)/2 && iBMP < BMP_X_SIZE;iTFT ++,iBMP++)
{
unsigned short colorTemp;
colorTemp = ScreenBitmap[jBMP * BMP_X_SIZE + iBMP];
pDisplayAddress[jTFT * LCD_XSIZE_TFT + iTFT] = Palette[colorTemp];
}
}
#endif
}
复制代码
这个函数在Main.c->static void InitDisplay(void)
这个函数里面调用就行了