How to take current screenshot and save it into mass storage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-23 2:52 AM
I want to take current screen screenshot and save it into JPEG or BMP image file format in mass storage.
I have seen saveScreenshot() function, but this is for Simulator.
I want to svae screenshot in STM32L4R5.
​
​
​Please comment if you have answers on this.
Thank you.​
Solved! Go to Solution.
- Labels:
-
STM32L4 Series
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-27 3:33 AM
Shouldn't be difficult to use something like libJPEG to create an image based on the pixels in the framebuffer, and then store it to some mass storage.
You can use something like the SnapShotWidget to create a copy of the framebuffer into another memory region, or you can create a custom widget that calls lockFrameBuffer(), adds a header, reads the pixels, converts them if necessary and stores them to sd-card.
/Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-23 11:09 AM
Good question (and i finally can´t answer it...). My approach would be: reading the actual framebuffer, adding a bmp header (as the format is known, when doing so ...) and save that alltogether into a file ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-27 3:33 AM
Shouldn't be difficult to use something like libJPEG to create an image based on the pixels in the framebuffer, and then store it to some mass storage.
You can use something like the SnapShotWidget to create a copy of the framebuffer into another memory region, or you can create a custom widget that calls lockFrameBuffer(), adds a header, reads the pixels, converts them if necessary and stores them to sd-card.
/Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-30 4:08 AM
Hi Martin,
Thanks for your support.
​
Yes i doing the same, lockFrameBuffer() and write buffer with image header​. but the screenshot file is to much big.
