新手上路
- 积分
- 43
- 金钱
- 43
- 注册时间
- 2018-6-16
- 在线时间
- 8 小时
|

楼主 |
发表于 2018-10-7 16:13:30
|
显示全部楼层
程序修改的地方
修改显示方向控制函数
LCD_Display_Dir(1);
在u8 spb_init(void)函数里添加横屏显示的分辨率
else if(lcddev.width==1280) //对于1280*800的LCD屏幕
{
icowidth=110;
micoyoff=18;
lcdtype=6;
icoindex=2;
spbdev.stabarheight=30;
spbdev.spbheight=610;
spbdev.spbwidth =1280;
spbdev.spbfontsize=16;
}
修改内存画点函数
void slcd_draw_point(u16 x,u16 y,u16 color)
{
if(lcdltdc.dir) //横屏
{
//if(lcdltdc.pwidth)y=spbdev.spbwidth*SPB_PAGE_NUM+spbdev.spbahwidth*2-1;
sramlcdbuf[x+y*(spbdev.spbwidth*SPB_PAGE_NUM+spbdev.spbahwidth*2)]=color;//横屏显示不需要坐标变换
} else //竖屏
{
if(lcdltdc.pwidth)x=spbdev.spbwidth*SPB_PAGE_NUM+spbdev.spbahwidth*2-x-1;
sramlcdbuf[y+x*spbdev.spbheight]=color;
}
}
修改void slcd_frame_show(u32 x)函数
if(lcdltdc.pwidth)
{
if(lcdltdc.dir) //横屏
{
x=x-1;//显示第一帧
LTDC_Color_Fill(0,spbdev.stabarheight,spbdev.spbwidth-1,spbdev.stabarheight+spbdev.spbheight-1,sramlcdbuf+x);
} else //竖屏
{
x=spbdev.spbwidth*(SPB_PAGE_NUM-1)+spbdev.spbahwidth*2-x-1;//计算图片显示的起始位置
LTDC_Color_Fill(0,spbdev.stabarheight,spbdev.spbwidth-1,spbdev.stabarheight+spbdev.spbheight-1,sramlcdbuf+x*spbdev.spbheight);//没看懂为什么显示偏移位置要乘以屏幕高度
}
} |
|