fb2png | Save Linux frambuffer to a PNG image file | Image Editing library
kandi X-RAY | fb2png Summary
kandi X-RAY | fb2png Summary
A program to read the Linux framebuffer and save it as a PNG file.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fb2png
fb2png Key Features
fb2png Examples and Code Snippets
Community Discussions
Trending Discussions on fb2png
QUESTION
How to get screenshot of graphical application programmatically? Application draw its window using EGL API via DRM/KMS.
I use Ubuntu Server 16.04.3 and graphical application written using Qt 5.9.2 with EGLFS QPA backend. It started from first virtual terminal (if matters), then it switch display to output in full HD graphical mode.
When I use utilities (e.g. fb2png
) which operates on /dev/fb?
, then only textmode contents of first virtual terminal (Ctrl+Alt+F1) are saved as screenshot.
It is hardly, that there are EGL API to get contents of any buffer from context of another process (it would be insecure), but maybe there are some mechanism (and library) to get access to final output of GPU?
...ANSWER
Answered 2018-Feb-28 at 18:21One way would be to get a screenshot from within your application, reading the contents of the back buffer with
glReadPixels()
. Or use QQuickWindow::grabWindow(), which internally usesglReadPixels()
in the correct way. This seems to be not an option for you, as you need to take a screenshot when the Qt app is frozen.The other way would be to use the DRM API to map the framebuffer and then
memcpy
the mapped pixels. This is implemented in Chromium OS with Python and can be translated to C easily, see https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/367611. The DRM API can also be used by another process than the Qt UI process that does the rendering.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fb2png
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page