cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to capture the screen image with the STM32F4 MCUs?

WPazH
Associate II

Hello,

I'm starting a project with an STM32F429IIT6 MCU, but I have a doubt. The project will have a display (I haven't decided yet if it will be 4.3" or 7"), and I'll be controlling the display with the MCU's internal TFT controller using TouchGFX. So far, so good. The issue is that the device needs to be able to capture a screenshot of the screen and save it to an internal microSD. Is this possible, or should I use an external driver to achieve this?

Best Regards,                                                                                                                                                                      Walter Paz.

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @WPazH ,

 

As @Tesla DeLorean have said, you can simply fetch the frame buffer data.

There is no way for TouchGFX to get the information of the pixels displayed on the screen but if you configured your project properly, your screen should display exactly what is stored in the frame buffer.

You just need to know the starting address of your frame buffer and its size (its size should be the size of your screen in pixel multiplied by the depth of your pixels color [16bpp for RGB565, 24bpp for RGB888, 32bpp for ARGB8888]) and copy the raw data into a buffer.
Then you could use the libpng library to convert it into a png, libpng is already used in TouchGFX.

 

As per how to store it into your micoSD, I cannot help you as it is out of the scope of TouchGFX and of my qualifications.
However, here is an example of Creating a File System on a SD card on STM32 .

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

4 REPLIES 4

As long as there aren't overlays you could likely fish the static image out of the frame buffer and write it to a bit map file. For BMP you'd need to handle the headers, and line ordering.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GaetanGodart
ST Employee

Hello @WPazH ,

 

As @Tesla DeLorean have said, you can simply fetch the frame buffer data.

There is no way for TouchGFX to get the information of the pixels displayed on the screen but if you configured your project properly, your screen should display exactly what is stored in the frame buffer.

You just need to know the starting address of your frame buffer and its size (its size should be the size of your screen in pixel multiplied by the depth of your pixels color [16bpp for RGB565, 24bpp for RGB888, 32bpp for ARGB8888]) and copy the raw data into a buffer.
Then you could use the libpng library to convert it into a png, libpng is already used in TouchGFX.

 

As per how to store it into your micoSD, I cannot help you as it is out of the scope of TouchGFX and of my qualifications.
However, here is an example of Creating a File System on a SD card on STM32 .

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Andrew Neil
Evangelist III

@WPazH wrote:

the device needs to be able to capture a screenshot of the screen and save it to an internal microSD. .


That seems a rather odd requirement - why does it "need" (sic?) to do that?

There may be other ways to achieve the end goal ...

GaetanGodart
ST Employee

Hello @WPazH ,

 

Was any of the above comment helpful to you?

Were you able to succeed in your project?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)