Discussion:
[directfb-users] saving current frame
Alla N
2012-09-12 10:15:52 UTC
Permalink
Hi,

I want to save a framebuffer to some file. Can I do it with DirectFB?

Thanks.
Alla N
2012-09-12 14:17:55 UTC
Permalink
Thank you. What about jpeg format? Can DirectFB save a snapshot to
this format or maybe to convert a PPM format to jpeg?

On Wed, Sep 12, 2012 at 4:04 PM, Oliver Gabel
Do you want to take a screenshot?
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
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.
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.
[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!
Post by Alla N
Hi,
I want to save a framebuffer to some file. Can I do it with DirectFB?
Thanks.
_______________________________________________
directfb-users mailing list
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
Loading...