We want to take screenshot of the LCD display of STM32F429I-Eval board using STemWin , how can this be done?
How to take screenshot of the display
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
Hi,
this can be done using the function GUI_BMP_Serialize(). There's an example in the manual on how to do this under Windows:
C Source Code
- static void _DrawSomething(void) {
- /* Draw something */
- GUI_DrawLine(10, 10, 100, 100);
- }
- static void _WriteByte2File(U8 Data, void * p) {
- U32 nWritten;
- WriteFile(*((HANDLE *)p), &Data, 1, &nWritten, NULL);
- }
- static void _ExportToFile(void) {
- HANDLE hFile = CreateFile("C:\\GUI_BMP_Serialize.bmp", GENERIC_WRITE, 0, 0,
- CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
- GUI_BMP_Serialize(_WriteByte2File, &hFile);
- CloseHandle(hFile);
- }
- void MainTask(void) {
- GUI_Init();
- _DrawSomething();
- _ExportToFile();
- }
Best regards,
FlorianPlease read the forum rules before posting.
Keep in mind, this is *not* a support forum.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support you can contact us via our support system: segger.com/ticket/
Or you can contact us via e-mail. -
If the screenshot has to be saved on the SD-card, what are the modifications that should be done.
-
Hi,
The example Florian has posted uses the Windows FS API. I suggest to use your own FS API to write to an SD card.
Attached is an example which uses either the Windows API or our own file system emFile.
Regards,
SvenPlease read the forum rules before posting.
Keep in mind, this is *not* a support forum.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support you can contact us via our support system: segger.com/ticket/
Or you can contact us via e-mail. -
Hi,
Thanks for the reply.
We used f_write() to write into SD card instead of WriteFile(), but the BMP image is not getting stored on the SD card.
Can you please help.
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0