经常看到大牛的Blog上的Demo的效果图是一个动态的gif,能很好的展示Demo程序运行状态。于是乎找度娘问问ubuntu下如何录制gif动态图。录视频可以找Kazam,录gif可以找byzanz。
1.安装byzanz:
sudo apt-get install byzanz
2.获取录制窗口的信息,比如XY坐标、高宽
xwininfo
终端输入xwininfo,然后用鼠标选择要录制的窗口,会有如下打印信息出来。
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x5a000de "/home/jindg/图片/选区_024.png - Shutter"
Absolute upper-left X: 334
Absolute upper-left Y: 150
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 709
Height: 500
Depth: 24
Visual: 0x20
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x22 (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: +334+150 -1603+150 -1603-374 +334-374
-geometry 709x500+324+112
其中:
Absolute upper-left X:录制窗口X坐标
Absolute upper-left Y:录制窗口Y坐标
Width:录制窗口宽
Height:录制窗口高
3.敲入如下命令开始录制,Ctrl+c结束录制:
byzanz-record -x 334 -y 150 -w 709 -h 500 ~/x.gif
参考:
http://blog.youkuaiyun.com/zheng5229875/article/details/47358963