How to make DirectFB screenshots

http://www.lirmm.fr/doc/libdirectfb-1.0-0/README.screenshots
How to make DirectFB screenshots
--------------------------------

There are two ways to generate DirectFB screenshots. The easy way is
to set the "screenshot-dir" parameter in the DirectFB configuration
file directfbrc or to pass it as a command-line option. See the
directfbrc man-page for more details. You can then generate screen
dumps in the PPM format by pressing the PrintScreen key.  The PPM
files can easily be converted to others formats using for example the
netpbm tools.

The hard way to do screenshots is to read directly from the frame
buffer device. This works for all applications that use the frame
buffer device, not only for DirectFB applications.

The resulting data is then converted to a more convenient format using
the netpbm graphics conversion tools.  If the frame buffer is not
running at 24 bit depth, the data has to be propagated to 24bit RGB
before netpbm can handle it. The tools directory contains the source
for two small utilities that do just this:

  raw16toraw24 is a small tool that reads 16bit RGB565 data from stdin,
  converts to 24bit RGB888 data and writes it to stdout.

  raw15toraw24 is a small tool that reads 15bit RGB555 data from stdin,
  converts to 24bit RGB888 data and writes it to stdout.

  raw32toraw24 is a small tool that reads 32bit ARGB data from stdin, 
  converts to 24bit RGB888 data and writes it to stdout.


The following steps have to be performed to take screenshots:

Step 1 - Log in from another computer using ssh or telnet. Start your 
         application and stop it by pressing Ctrl+C in the remote
	 terminal.

Step 2 - Read data from /dev/fb0 and write it to a file.

 examples:
  [15bit]  raw15toraw24 < /dev/fb0 > raw24.tmp
  [16bit]  raw16toraw24 < /dev/fb0 > raw24.tmp
  [24bit]  cat /dev/fb0 > raw24.tmp
  [32bit]  raw32toraw24 < /dev/fb0 > raw24.tmp

Step 2 - Convert data to ppm using rawtoppm and specify the resolution of
         the frame buffer.

 example:  rawtoppm 800 600 raw24.tmp > ppm24.tmp

Step 3 - Convert ppm to png using pnmtopng.

 example : pnmtopng <ppm24.tmp >screenshot.png


Thats it!


居然最后的结果是个空图片,哈需要尝试

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值