linux抓图工具在哪?

linux抓图工具在哪?... linux抓图工具在哪? 展开
 我来答
tongxuefengwo
2009-05-12 · TA获得超过697个赞
知道小有建树答主
回答量:495
采纳率:0%
帮助的人:304万
展开全部
gimp就可以,文件--获取--屏幕抓图
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
梁昌仔
推荐于2016-09-01 · TA获得超过272个赞
知道小有建树答主
回答量:287
采纳率:0%
帮助的人:187万
展开全部
没有什么现成的抓图工具,不过我可以给你代码。
framebuffer直接转bmp图片
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/ioctl.h>

typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef long LONG;

typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
}__attribute__((packed)) BITMAPFILEHEADER, *PBITMAPFILEHEADER;

typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
}__attribute__((packed)) BITMAPINFOHEADER, *PBITMAPINFOHEADER;

typedef struct tagRGBQUAD {
BYTE rgbBlue;
BYTE rgbGreen;
BYTE rgbRed;
BYTE rgbReserved;
}__attribute__((packed)) RGBQUAD;

#define FRAME_BUFFER_PATH "/dev/fb0"
int main(int argc, char *argv[])
{
int i;
int img_fd, fb_fd;
int data_size;
char *img_buf;
struct fb_var_screeninfo var_info;
BITMAPFILEHEADER file_head;
BITMAPINFOHEADER info_head;
//RGBQUAD rgb_quad;

if (argc != 2)
{
printf("usage %s bmp_file\n", argv[0]);
return -1;
}

/*open files*/
fb_fd = open(FRAME_BUFFER_PATH, O_RDWR);
if (img_fd < 0)
{
perror("open framebuff");
return -1;
}
if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &var_info) < 0)
{
perror("ioctl FBIOGET_VSCREENINFO");
close(img_fd);
return 0;
}
printf("xres %d, yres %d\n", var_info.xres, var_info.yres);

img_fd = open(argv[1], O_RDWR | O_CREAT, 0644);
if (img_fd < 0)
{
perror("open image");
close(img_fd);
return -1;
}

data_size = var_info.xres*var_info.yres*(var_info.bits_per_pixel/8);
/*initialize bmp structs*/
file_head.bfType = 0x4d42;
file_head.bfSize = sizeof(file_head) + sizeof(info_head) + data_size;
file_head.bfReserved1 = file_head.bfReserved2 = 0;
file_head.bfOffBits = sizeof(file_head) + sizeof(info_head);

info_head.biSize = sizeof(info_head);
info_head.biWidth = var_info.xres;
info_head.biHeight = var_info.yres;
info_head.biPlanes = 1;
info_head.biBitCount = var_info.bits_per_pixel;
info_head.biCompression = 0;
info_head.biSizeImage = 0;
info_head.biXPelsPerMeter = 0;
info_head.biYPelsPerMeter = 0;
info_head.biClrUsed = 0;
info_head.biClrImportant = 0;

img_buf = (char *)malloc(data_size);
if (img_buf == NULL)
{
printf("malloc failed!\n");
close(fb_fd);
close(img_fd);
return -1;
}

/*read img data and */
read(fb_fd, img_buf, data_size);

write(img_fd, &file_head, sizeof(file_head));
write(img_fd, &info_head, sizeof(info_head));

/*revese img and write to file*/
for (i = 0; i < var_info.yres; i++)
{
write(img_fd, img_buf + var_info.xres*(var_info.yres-i-1)*(var_info.bits_per_pixel/8),
var_info.xres*(var_info.bits_per_pixel/8));
}

close(fb_fd);
close(img_fd);
return 0;
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
xzqjjcc
2009-05-12 · TA获得超过644个赞
知道小有建树答主
回答量:95
采纳率:0%
帮助的人:0
展开全部
在linux系统桌面上,选择“开始->图像->;屏幕截图程序”,打开抓图窗口,你可以根据需要抓图了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
wingofray
2009-05-12 · TA获得超过3407个赞
知道大有可为答主
回答量:3151
采纳率:0%
帮助的人:3001万
展开全部
如果使用的是gnome,直接按printscreen键就弹出来了;
也可以用gimp,还可以延时截图,很方便。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
炜通雨
2015-07-09 · TA获得超过903个赞
知道小有建树答主
回答量:321
采纳率:100%
帮助的人:95.6万
展开全部
Linux有一个系统自带的抓图工具,你找一下,还是挺好用的,我的是Ubuntu,其他类Linux未必有这工具。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(5)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式