在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
芯片精品文章合集(500篇!)    创芯人才网--重磅上线啦!
查看: 5149|回复: 0

[求助] arm linux framebuffer 显示bmp图片

[复制链接]
发表于 2011-7-6 11:17:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
arm上显示bmp图片时,图片显示不够完整,不知道是像素点的坐标不对,还是在使用framebuferr时出了问题?
关键代码如下:
while(!feof(fp))
{
  PIXEL pix;
  unsigned short int tmp;
  rc = fread( (char *)&pix, 1, sizeof(unsigned short int), fp );
  if (rc != sizeof(unsigned short int) )
  { break; }
//  location = line_x * bits_per_pixel / 8 + (ciHeight - line_y - 1) * xres * bits_per_pixel / 8;
//  location = line_x * bits_per_pixel / 8 + (line_y ) * yres * bits_per_pixel / 8;
//  location = line_x * bits_per_pixel / 8 + (line_y ) * yres* bits_per_pixel / 8;
  location = line_x * xres* bits_per_pixel / 8 + (line_y ) * bits_per_pixel / 8;
  tmp=pix.red<<11 | pix.green<<6 | pix.blue;
  *((unsigned short int*)(fbp + location)) = tmp;

/*
  line_y++;
   if (line_y == ciHeight )
   {
    line_y = 0;
    line_x++;

    if(line_x==ciWidth)
    {
     break;
    }
   }
*/
  line_x++;
  if (line_x == ciWidth)
  {
   line_x = 0;
   line_y++;

   if(line_y== ciHeight )
   {
    break;
   }
  }
}
其中fbp为framebuffer的指针
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-19 11:17 , Processed in 0.017860 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表