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. <code>fbgrab<By using the well-known [https:/code> is a small utility that /imagemagick.org/ ImageMagick suite], this job can be used for this jobaccomplished straightforwardly. This Application Note (AN) shows how to use it on a system running a XELK-based Yocto Linux distribution.
==Installing <code>fbgrabImageMagick convert</code>==Assuming that root file system provides the [[XELK-AN-003:_Package_Management_with_Yocto|<code>smart</code> tool]]and it is set up properly, the <code>fbgrabImageMagick</code> utility package can be installed as follows:
Alternatively, if the <code>convert</code> utility can not be installed onto the target's root filesystem, the raw data file <code>testscreenshot.fbraw</code> can be copied to a Linux host where <code>fbgrabconvert</code> is installedavailable.
It is also worth remembering that, if the screen parameters such as 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 parametersthem:
<pre class="board-terminal">
root@sznpc:~# fbset
mode "1024x600-67"
# D: 51.201 MHz, H: 43.538 kHz, V: 67.085 Hz
geometry 1024 600 1024 600 32
timings 19531 104 43 24 20 5 5
accel false
rgba 8/16,8/8,8/0,8/24
endmode
</pre>
The numbers following <code>geometry</code> indicate the resolution (1024x600) and the bits required to represent a pixel (32). The last line tells the pixel format (RGBA). In this case, 8 bits are used for each channel (reg, green, blue, and alpha) resulting in 32 bits combined. That is why the <code>depth</code> parameter of <code>convert</code> was set to 8 and the format was set to <code>rgba</code>.