在用神舟三号
开发板的液晶显示中有如下语句不太懂,请大虾们指点指点!
/****************************************************************************
* 名 称:void ili9320_DrawPicture(u16 StartX,u16 StartY,u16 EndX,u16 EndY,u16 *pic)
* 功 能:在指定座标范围显示一副图片
* 入口参数:StartX 行起始座标
* StartY 列起始座标
* EndX 行结束座标
* EndY 列结束座标
pic 图片头指针
* 出口参数:无
* 说 明:图片取模格式为水平扫描,16位颜 {MOD}模式
* 调用方法:ili9320_DrawPicture(0,0,100,100,(u16*)demo);
* 作 者: www.
ARMjishu.com
****************************************************************************/
void ili9320_DrawPicture(u16 StartX,u16 StartY,u16 EndX,u16 EndY,u16 *pic)
{
u32 i, total;
u16 data1,data2,data3;
u16 *picturepointer = pic;
u16 x,y;
printf("ili9320_DrawPicture StartX %d StartY %d EndX %d EndY %d
", StartX, StartY, EndX, EndY);
x=StartX;
y=StartY;
total = (EndX - StartX + 1)*(EndY - StartY + 1 )/2;
for (i=0;i<total;i++)
{
data1 = *picturepointer++;
data2 = *picturepointer++;
data3 = ((data1 >>3)& 0x001f) |((data1>>5) & 0x07E0) | ((data2<<8) & 0xF800);此词语的作用是什么?具体怎样理解!
ili9320_SetPoint(x,y,data3);
y++;
if(y > EndY)
{
x++;
y=StartY;
}
data1 = *picturepointer++;
data2 = *picturepointer++;
data3 = ((data1 >>11)& 0x001f) |((data2<<3) & 0x07E0) | ((data2) & 0xF800);此语句与上面语句在功能上有何区别?具体如何理解!
ili9320_SetPoint(x,y,data3);
y++;
if(y > EndY)
{
x++;
y=StartY;
}
}
}
望大侠们帮忙指点指点!谢谢啦!
哦,这样啊!谢谢啦!
一周热门 更多>