2020-04-23 02: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.
2020-04-27 03: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
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 ...
2020-04-27 03: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
2020-04-30 04: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.