summaryrefslogtreecommitdiff
path: root/Source/DirectFB/docs/README.screenshots
blob: 7df9595ce08e7da97409f7f7ef8ca027a40009c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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!