您的位置:首页 > 其它

LCD显示图片的函数-ARM体系-2440

2017-08-21 16:25 288 查看
void Paint_BMP(int x0,int y0,int level,int vertical,const unsigned char *bmp)/*在屏幕上画图*/
{
int x,y;
UINT32 col;
int p = 0;
UINT16 *addr;

for( y = 0 ; y < 272 ; y++ )
{
for( x = 0 ; x < 480 ; x++ )
{
col = bmp[p+1] | (bmp[p]<<8) ;
// if ( ( (x0+x) < SCR_XSIZE) && ( (y0+y) < SCR_YSIZE) )
// LCD_BUFFER[y0+y][x0+x] = c ;
PutPixel1(x0+x, y0+y, col);
p += 2 ;
}
}
}

void PutPixel1(UINT32 x, UINT32 y, UINT32 color)
{
UINT8 red,green,blue;

switch (bpp){
case 16:
{
UINT16 *addr = (UINT16 *)fb_base_addr + (y * xsize + x);
*addr = (UINT16) color;
break;
}

case 8:
{
UINT8 *addr = (UINT8 *)fb_base_addr + (y * xsize + x);
*addr = (UINT8) color;
break;
}

default:
break;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  2440 嵌入式 图片