struct fb_fix_screeninfo 该结构体保存的是关于屏幕固定的参数code
struct fb_var_screeninfo 该结构体保存的是关于屏幕变化的参数,须要获取frame buffer以前,这个结构体须要更新。class
fb_var_screeninfo 的参数介绍
date
xres 可见矩形的widthim
yres 可见矩形的heightimg
xres_virtual vi
yres_virtualcopy
xoffsetco
yoffset结构体
void copyFromFrameBuffer() { kesyPrintf("copyFromFrameBuffer\n"); update_fb_info(); char* vfd = (char*)readBufferFB(); void const* base = 0; int bytespp = 4; size_t offset = fscrinfo.line_length * scrinfo.yoffset + (scrinfo.xoffset) * bytespp; base = (void const *)((char const *)vfd + offset); int w = scrinfo.xres; int h = scrinfo.yres; int s = scrinfo.xres_virtual; kesyPrintf("w=%d,h=%d,s=%d\n", w, h, s); int y = 0; for (y=0 ; y<h ; y++) { memcpy(gNewBuf + y*w*bytespp, base, w*bytespp); base = (void *)((char *)base + fscrinfo.line_length); } }