EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
设计目标:
! N* v- n7 a- g- S0 N0 }3 C7 I①实现用户注册、用户名、密码输入登录功能
$ i1 Q: O# p& F% U- H②实现bmp图片居中显示、左右切换、缩放1 t# [' E5 S, l* p4 ~( u9 s4 F& x. e
③实现音乐(MP3)的播放、暂停、切歌、播放模式设定 . s7 N# |9 S, u% F9 k" f. i% C' B
④实现视频(WMV)的播放、暂停、切换 ![]()
部分效果如下: 视频操作部分
& [3 P# j: X: g v1 [![]() 点击切换
8 J. u! g; H5 G![]() 划动切换与缩小
8 |! b# J5 L5 Z![]() 划动退出
& @8 X) d# q- ]* [% K+ f![]() **注意!注意!**编译命令是用 ARM-linux-gcc,而不是gcc的 主头文件(各部分通用的函数、定义) q, g( H5 ~( ~8 B: V
myhead.h #include <stdio.h> #include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdbool.h>#include <sys/mman.h>#include <linux/input.h>#include <errno.h>#include <dirent.h>#ifndef MYHEAD_H#define MYHEAD_Hstruct input_event myevent; //定义输入子系统模型有关的结构体变量int tsfd ; //触摸屏驱动int dst; //显示屏驱动int tx1 = 0,ty1 = 0,tx2 = 0,ty2 = 0; //触摸屏返回值//重置触摸屏坐标返回值void clear(){ tx1 = 0, ty1 = 0,tx2 = 0,ty2 = 0;}//打开显示屏int display_open(){ dst = open("/dev/fb0",O_RDWR); //打开显示屏驱动 if(dst == -1) { printf("显示屏打开失败!\n"); return -1; }}//关闭显示屏int display_close(){ close(dst);}//打开触摸屏int touch_open() { tsfd=open("/dev/input/event0",O_RDWR); //打开触摸屏驱动 if(tsfd==-1) { perror("打开触摸屏失败!\n"); return -1; } return 0; }//关闭触摸屏int touch_close() { close(tsfd); return 0;}//显示任意位置大小缩放的BMP图片bool showbmp(char *bmppath, int n) { int w = 0; int h = 0; int src = open(bmppath , O_RDWR); lseek(src, 18 ,SEEK_SET); //获取BMP图片的宽w信息 read(src, &w, 4); lseek(src, 22 [color=rgb(153, 153, 15魘1 |