Difference between revisions of "XELK-AN-010: Capturing framebuffer screenshots"

From DAVE Developer's Wiki
Jump to: navigation, search
(Capturing screenshots)
Line 52: Line 52:
 
Alternatively, if the <code>fbgrab</code> utility can not be installed onto the target's root filesyste, the raw data file <code>test.fb</code> can be copied to a Linux host where <code>fbgrab</code> is available.
 
Alternatively, if the <code>fbgrab</code> utility can not be installed onto the target's root filesyste, the raw data file <code>test.fb</code> can be copied to a Linux host where <code>fbgrab</code> is available.
  
It is also worth remembering that, if the resolution and/or pixel depth are unknown, the [http://spblinux.de/2.0/doc/fbset.html <code>fbset</code> tool] can be used to display such parameters:
+
It is also worth remembering that, if the screen parameters such as resolution or pixel depth are unknown, the [http://spblinux.de/2.0/doc/fbset.html <code>fbset</code> tool] can be used to display them:
 
<pre class="board-terminal">
 
<pre class="board-terminal">
 
</pre>
 
</pre>

Revision as of 08:37, 4 February 2021

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, if the fbgrab utility can not be installed onto the target's root filesyste, the raw data file test.fb can be copied to a Linux host where fbgrab is available.

It is also worth remembering that, if the screen parameters such as resolution or pixel depth are unknown, the fbset tool can be used to display them: