简介
大神写博客的demo都带演示的,不得不说视觉真是太吊了,很多时候一大段文字讲不明白的事,动图辅助后,简单明了!
工具
主要用byzanz
工具来进行gif图制作
安装
sudo apt-get install byzanz
byzanz-record --help
# 查看帮助
指令信息
我们只关注这几个参数即可
- -d 动画录制的时间,默认录制10秒
- -e 动画开始延迟
- -x 录制区域的起始X坐标
- -y 录制区域的起始Y坐标
- -w 录制区域的宽度
- -y 录制区域的高度
获取录制区域信息
如何获取录制区域的坐标和高度呢,其实系统自带这个命令工具.
输入xwininfo
会提示你选择一个窗口,点击之后会返回这个窗口的详细信息
如图所示,我点击浏览器框的左上角
返回
xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x2800025 "【计算机视觉】乒乓球的实时时空视频分析_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili - Google Chrome"
Absolute upper-left X: 360
Absolute upper-left Y: 113
Relative upper-left X: 360
Relative upper-left Y: 113
Width: 1280
Height: 836
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +360+113 -2840+113 -2840-491 +360-491
-geometry 1280x836+360+113
有用的信息有
Absolute upper-left X: 360
Absolute upper-left Y: 113
Width: 1280
Height: 836
录制
byzanz-record -x 360 -y 113 -w 1280 -h 836 -d 5 /home/cheng/Desktop/xx.gif
从 (360,113)为起始点,宽1280,高836 -d 录制5s, 输出至/home/cheng/Desktop/xx.gif