XELK-AN-010: Capturing framebuffer screenshots

From DAVE Developer's Wiki
Revision as of 17:17, 3 February 2021 by U0001 (talk | contribs) (Created page with "{{InfoBoxTop}} {{AppliesToAxel}} {{AppliesToAxelEsatta}} {{AppliesToAxelLite}} {{AppliesToAXEL Lite AN}} {{AppliesToSMARX AN}} {{AppliesToAXELULite}} {{AppliesToAXEL ULite AN}...")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Info Box
Axel-04.png Applies to Axel Ultra
Axel-02.png Applies to AXEL ESATTA
Axel-lite 02.png Applies to Axel Lite
AXEL ULite-top.png Applies to AXEL ULite
SBC Lynx-top.png Applies to SBC Lynx


200px-Emblem-important.svg.png

This application note has been validated using the kit version in the History table.

History[edit | edit source]

Version Date Development Kit version
1.0.0 February 2021 XELK 4.0.0 , XUELK 2.0.3

Introduction[edit | edit source]

In certain situations, it is necessary and/or convenient to grab a screenshot of the full display from the framebuffer directly, for example for debugging purposes or documentation. fbgrab is a small utility that can be used for this job. This Application Note (AN) shows how to use it on a system running a XELK-based Yocto Linux distribution.

Installing fbgrab[edit | edit source]

Assuming that root file system provides the smart tool, the fbgrab utility can be installed as follows:


Capturing screenshots[edit | edit source]

The following examples refer to a system using a 1024x768 16bpp framebuffer, which is mapped to /dev/fb0.

When the display shows the image to be captured, to grab a "raw" screenshot and save it to file, issue the following command:

cat /dev/fb0 > test.fb

Then convert the raw data to a PNG image file, run the following command:

./fbgrab -w 1024 -h 768 -b 16 -l 1024 -f test.fb test.png
Converting image from 16
Now writing PNG file (compression -1)

Alternatively, the raw data file test.fb can be copied to a Linux host where fbgrab is installed.

It is worth remembering that, if the resolution and/or pixel depth are unknown, the [fbset tool http://spblinux.de/2.0/doc/fbset.html] can be used to display such parameters: