📄 showjpg.c
字号:
#include <stdio.h>#include <fcntl.h>intmain (void){ int fp; int x; int width, height; unsigned char *image; char buf = 0x00; fp = open ("/dev/fb/0", O_RDWR); if (fp < 0) { printf ("Error : Can not open framebuffer device\n"); exit (1); } read_jpeg("pic.jpg", &width, &height, &image); if ((width != 240) || (height != 320)) { printf("Error: not a 240*320 picture\n"); exit(1); } for (x = 0; x < 240 * 320 * 3; x+=3) { write (fp, &image[x+2], 1); write (fp, &image[x+1], 1); write (fp, &image[x], 1); write (fp, &buf, 1); } close (fp);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -