#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
int main()
{
int fd;
struct fb_var_screeninfo screen_info;
fd = open("/dev/fb0",O_RDWR);
ioctl(fd,FBIOGET_VSCREENINFO,&screen_info);
printf("dump_display:%d*%d\n",screen_info.xres,screen_info.yres);
close(fd);
}
以上是获取屏幕宽高,