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


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;
    }
}


你可能感兴趣的:(嵌入式软件开发,Linux)