Open main menu

DAVE Developer's Wiki β

Changes

XELK-AN-010: Capturing framebuffer screenshots

17 bytes added, 10:21, 25 August 2023
no edit summary
{{AppliesToAxelEsatta}}
{{AppliesToAxelLite}}
{{AppliesToAXEL Lite AN}}
{{AppliesToSMARX AN}}
{{AppliesToAXELULite}}
{{AppliesToAXEL ULite AN}}
{{AppliesToSBCLynx}}
{{AppliesTo SBC Lynx AN}}
{{InfoBoxBottom}}
| 1.0.0
| February 2021
|[[Axel_Embedded_Linux_Kit_(XELK)#XELK_3.0.01|XELK 3.0.01]] ,
|-
|}
==Introduction==
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. By using the well-known [https://imagemagick.org/ ImageMagick toolsuite], this job can be accomplished straightforwardly. This Application Note (AN) shows how to use it on a system running a XELK-based Yocto Linux distribution.
==Installing <code>ImageMagick 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>ImageMagick</code> package can be installed as follows:
<pre class="board-terminal">
</pre>
Then convert the raw data to a PNG image file, run by running the following command:
<pre class="board-terminal">
root@sznpc:~# convert -size 1024x600 -depth 8 rgba:screenshot.raw screen0.png
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 8and the format was set to <code>rgba</code>.
8,226
edits