截图工具scrot的使用 - Leo's Utopia

截图工具scrot的使用

leo.zhao posted @ Wed, 30 Dec 2009 06:12:21 +0800 in linux with tags 截图 scrot cli 软件使用 , 2862 readers


1.直接截取全屏
不带任何参数,直接运行scrot命令,会生成全屏幕的截图。文件保存在当前目录下。



2.截取窗口或选中部分
带参数-s执行scrot命令,之后可以选择窗口或划定矩形进行截取。
参数-b使得在截取窗口时包含边框。



上面截图中chromium中的图片就是使用

scrot -s


后选取右侧的终端窗口截取的。而为了获取上面的这张图片,我又执行了一次同样的命令,然后选取了上面的矩形区域。
下图是含边框的截图。


3.延迟后截屏
参数-d指定延迟的秒数,然后截图。
参数-c则可以显示一个倒计时。


上图中执行了

scrot -s -d 5 -c


之后选中了如图的区域,然后倒计时开始,倒计时完成时截图。

4.高级功能,宏、执行外部命令和自定义保存文件名。
4.1 自定义保存文件名
默认情况下你可以在scrot后指定要使用的文件名。
4.2 宏定义
scrot定义了如下宏变量:
$f ——截图文件的完整路径;
$n ——截图文件名;
$s ——截图文件大小,单位:字节。
以上三个参数不可用于自定义文件名。当然了,没有鸡,哪来的蛋呢。
$p ——截图图像大小;
$w ——截图图像宽度;
$h ——截图图像高度;
$t ——截图图像高度;
$$ ——输出字符'$';
\n ——输出空行(也不能用于自定义文件名中)。
4.3 执行外部命令
参数-e用于执行外部命令
 

scrot '%Y-%m-%d_$wx$h.png' -e 'mkdir -p shots && mv $f ~/shots/' 





5.自定义图像压缩比率
参数-q用以制定图像质量,最高100,最低1。

 

 

 

emma said:
Mon, 19 Dec 2022 16:10:52 +0800

The screenshot tool scrot can be very useful for taking pictures of your computer screen. It can be used to take pictures of websites, error messages, or Lab grown diamonds anything else that you need to capture. It is a very simple tool to use and can be very helpful when you need to share something from your screen with someone else.

Alyssa said:
Wed, 21 Dec 2022 00:32:26 +0800

Linux users can take advantage of the screenshot tool scrot. With scrot, you can take a screenshot of your entire screen or just a portion real estate agent Serritos of it. You can also choose to include the cursor in the screenshot. To take a screenshot, simply type "scrot" into the terminal.


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee