linux电⼦相册登录界⾯代码,基于Liunx系统和6818开发板的电
⼦相册附源程序
电⼦相册实现滑动解锁、JPG和BMP图⽚显⽰  ⽤到的技巧有⽂件/系统IO函数,双向循环链表,⽬录检索和BMP,JPG图⽚显⽰的函数
源码在压缩包⾥
int main(int argc, char *argv[])
{
//初始化设备
Lcd_Init();
//显⽰锁屏界⾯
Show_bmp(0, 0,"lock.bmp");
usleep(1000);
//显⽰锁屏logo
Show_bmp(100, 370,"logo.bmp");
while(1)
{
//获取坐标
get_ts_xy();
Show_bmp(100,370,"frame.bmp");
usleep(10);
//触摸得到x轴变化的坐标,锁屏界⾯和logo的图标交替刷新,达到logo移动的效果
Show_bmp(a, 370,"logo.bmp");
//判断滑块到达锁屏框最后,松⼿则跳出循环
if(ts_x2 >= 420&&ts_y2>370&&ts_y2<450)
{
break;
}
}
//在锁屏框最后显⽰解锁成功的logo
Show_bmp(420, 370,"unlock.bmp");
usleep(500000);  //延时0.5秒
printf("success!!\n");
/*****************************************************************/
d_list = Create_List();
D_Node *p=NULL;
//播放⾳乐
system("madplay faded.mp3 &");
//检索指定⽬录⾥的所有bmp图⽚,并添加进链表
search_dir("./pic");
p=d_list->next;
printf("It's never too late to learn!\n");
int flag1;
while(1)
{
//显⽰解锁后的主页⾯
Show_bmp(0, 0, "main.bmp");
get_x1y1();
//循环显⽰照⽚
if(x_2>55&&x_2<315&&y_2>390&&y_2<460)
{
flag1 = 0;
while(1)
{
//检测bmp图⽚并下拉显⽰bmp图⽚
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0&&flag1 == 0) {
Show_4_bmp(p->picname);
show_buf1();
printf("This is bmp\n");
flag1 = 1;
}
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0)
{
p=p->next;
usleep(1000000);
}
//跳出循环
if(strcmp("00.bmp", p->picname+strlen(p->picname)-6) == 0)
{
break;
}
//检测bmp图⽚并上拉显⽰bmp图⽚
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0&&flag1 == 1) {
Show_4_bmp(p->picname);
show_buf2();
printf("This is bmp\n");
flag1 = 0;
}
//检测jpg图⽚并显⽰jpg图⽚
if( strcmp(".jpg", p->picname + strlen(p->picname)-4) == 0)
{
show_jpg(p->picname);
printf("This is jpg\n");
}
usleep(1000000);        //延时1秒
p=p->next;
//跳出循环
if(strcmp("00.bmp", p->picname+strlen(p->picname)-6) == 0)
电影源代码 下载{
break;
}
}
}
//滑动显⽰照⽚
if(x_2>490&&x_2<750&&y_2>390&&y_2<460)
{
flag1 = 0;
p=d_list->next;
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0)
{
Show_4_bmp(p->picname);
show_buf1();
printf("This is bmp\n");
}
if( strcmp(".jpg", p->picname + strlen(p->picname)-4) == 0) {
show_jpg(p->picname);
printf("This is jpg\n");
}
while(1)
{
get_x1y1();
get_flag();
/
/向右滑
if(i == 1)
{
p = p->next;
//向右慢慢显⽰bmp照⽚
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0) {
Show_4_bmp(p->picname);
show_buf5();
printf("This is bmp\n");
}
//显⽰jpg图⽚
if( strcmp(".jpg", p->picname + strlen(p->picname)-4) == 0) {
show_jpg(p->picname);
printf("This is jpg\n");
}
if(p == d_list)
{
p = p->next;
}
}
//向左滑
if(i == 2)
{
p = p->prev;
//向左慢慢显⽰bmp照⽚
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0)
{
Show_4_bmp(p->picname);
show_buf6();
printf("This is bmp\n");
}
if( strcmp(".jpg", p->picname + strlen(p->picname)-4) == 0)
{
show_jpg(p->picname);
printf("This is jpg\n");
}
if(p == d_list)
{
p = p->prev;
}
}
//向上滑
if(i == 3)
{
break;
}
//向下滑
if(i == 4)
{
p=d_list->next;
while(1)
{
//横向百叶窗显⽰bmp图⽚
if( strcmp(".bmp", p->picname + strlen(p->picname)-4) == 0&&flag1 == 0)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。