新手入门
- 积分
- 27
- 金钱
- 27
- 注册时间
- 2014-7-12
- 在线时间
- 0 小时
|
5金钱
原子哥的FATFS文件系统 图片显示的实验中为什么图片是从下网上扫的?
问题1:我看了好久的程序也没看明白.. 起始点明明设置的是x=0,y=0偏移量也是0,但是图片就是从下往上扫的?
问题2:FATFS系统的图片显示程序是不是就是解码那个.c 文件完成的?例如读后缀为 bmp 的文件,显示图片的任务就给bmp.c去做了?
这是主函数调用的:
ai_load_picfile(pname,0,0,lcddev.width,lcddev.height);//显示图片
这个函数:
//智能画图
//FileName:要显示的图片文件 BMP/JPG/JPEG/GIF
//x,y,width,height:坐标及显示区域尺寸
//acolor :alphablend的颜色(仅对不大于320*240的32位bmp有效)
//abdnum :alphablend????(0~32有效,其余值表示不使用alphablend,仅对不大于320*240的32位有效)
//图片在开始和结束的坐标点范围内显示
// pname,0,0,lcddev.width,lcddev.height
u8 ai_load_picfile(const u8 *filename,u16 x,u16 y,u16 width,u16 height)
{
u8 res;
u8 temp;
if((x+width)>lcddev.width)return PIC_WINDOW_ERR;
if((y+height)>lcddev.height)return PIC_WINDOW_ERR;
if(width==0||height==0)return PIC_WINDOW_ERR;
picinfo.S_Height=height;
picinfo.S_Width=width;
if(picinfo.S_Height==0||picinfo.S_Width==0)
{
picinfo.S_Height=lcddev.height;
picinfo.S_Width=lcddev.width;
return FALSE;
}
picinfo.S_XOFF=x;
picinfo.S_YOFF=y;
temp=f_typetell((u8*)filename);
switch(temp)
{
case T_BMP:
res=stdbmp_decode(filename);
break;
case T_JPG:
case T_JPEG:
res=jpg_decode(filename);
break;
case T_GIF:
res=gif_decode(filename,x,y,width,height);
break;
default:
res=PIC_FORMAT_ERR;
break;
}
return res;
}
|
|