linux frame buffer grab
linux的驱动就是个字符设备,可以用read write ioctl mmap操作,通过/dev/fbx可以像文件一样直接读写
截屏dd if=/dev/fb0 of=snapshot
恢复cat snapshot > /dev/fb0
开源的有fbgrab工具,不过是生成png文件,我自己写了一个生成bmp文件的工具叫fbcap,录制成avi格式,通过socket或serial把设备的操作发送到host上:)。
保存bmp文件代码:
int savebmp(char* filename, int size, int bmWidth, int bmHeight, int bmBitsPixel, unsigned char* buffer)
{
FILE *fp = NULL;
int j = bmHeight;
int nColors = 0;
int nPeletteLen = 0;
RGBQUAD *rgbquad = NULL;
fp = fopen(filename, "w+");
if(fp == NULL)
{
printf("open file :%s fail\n", filename);
return -1;
}
printf("size=%d, width=%d, height=%d, bitsPixel=%d\n", size, bmWidth, bmHeight, bmBitsPixel);
if (bmBitsPixel <= 8)
{
nColors = bmBitsPixel << 1;
nPeletteLen = nColors * sizeof(RGBQUAD);
rgbquad= malloc(sizeof(RGBQUAD)*nColors);
if (rgbquad == NULL)
{
fclose(fp);
return -1;
}
memset(rgbquad, 0, nColors * sizeof(RGBQUAD));
int index = 0;
for(index = 0; index < nColors; index++)
{
rgbquad[index].rgbBlue = index;
rgbquad[index].rgbGreen = index;
rgbquad[index].rgbRed = index;
}
#if 1
if (bmBitsPixel == 1)//blue word,white backgroud
{
rgbquad[nColors -2].rgbBlue = 255;
rgbquad[nColors -2].rgbGreen = 255;
rgbquad[nColors -2].rgbRed = 255;
rgbquad[nColors -1].rgbBlue = 0xff;
rgbquad[nColors -1].rgbGreen = 0;
rgbquad[nColors -1].rgbRed = 0;
}
#else
if (bmBitsPixel == 1)//white word,black backgroud
{
rgbquad[nColors -2].rgbBlue = 0 ;
rgbquad[nColors -2].rgbGreen = 0;
rgbquad[nColors -2].rgbRed = 0;
rgbquad[nColors -1].rgbBlue =0xFF;
rgbquad[nColors -1].rgbGreen = 0xff;
rgbquad[nColors -1].rgbRed = 0xFF;
}
#endif
}
printf("nColors=%d,pelettelen=%d\n",nColors, nPeletteLen);
//
BITMAPFILEHEADER bfh;
bfh.bfType = ((unsigned short)('M'<< 8)|'B');
bfh.bfRe
相关文档:
install
1.作用
install命令的作用是安装或升级软件或备份数据,它的使用权限是所有用户。
2.格式
(1)install [选项]... 来源 目的地
(2)install [选项]... 来源... 目录
(3)install -d [选项]... 目录...
在前两种格式中,会将<来源>复制至<目的地>或将多个<来源>文件复制至已存在的< ......
Q. How do I install Languages in Linux after installation? I don’t have any language specific support installed but need to install the same. I’m using both RHEL 5 and CentOS 5.
A. Yellow dog Updater, Modified, a package manager for RPM-compatible Linux systems such as Cento ......
在LINUX的时钟中断中涉及至二个全局变量一个是xtime,它是timeval数据结构变量,另一个则是jiffies,首先看timeval结构
struct timeval
{
time_t tv_sec; /***second***/
susecond_t tv_usec;/***microsecond***/
}
到底microsecond是毫秒还是微秒??
1秒=1000毫秒(3个零),1秒=1000 000微秒(6个零),1秒=1 ......
转自: http://blog.csdn.net/kongqz/archive/2009/05/15/4184415.aspx
就是在已有的数据库实例上创建一个新的帐号,访问一些新的表
操作步骤如下:
1、登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户)
2、以sysdba方式来打开sqlplus,命令如下: s ......
就是在已有的数据库实例上创建一个新的帐号,访问一些新的表
操作步骤如下:
1、登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户)
2、以sysdba方式来打开sqlplus,命令如下: sqlplus "/as sysdba"
3、查看我们常规将用户表空间放置位置 ......