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

      1. static void _DrawSomething(void) {
      2. /* Draw something */
      3. GUI_DrawLine(10, 10, 100, 100);
      4. }
      5. static void _WriteByte2File(U8 Data, void * p) {
      6. U32 nWritten;
      7. WriteFile(*((HANDLE *)p), &Data, 1, &nWritten, NULL);
      8. }
      9. static void _ExportToFile(void) {
      10. HANDLE hFile = CreateFile("C:\\GUI_BMP_Serialize.bmp", GENERIC_WRITE, 0, 0,
      11. CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
      12. GUI_BMP_Serialize(_WriteByte2File, &hFile);
      13. CloseHandle(hFile);
      14. }
      15. void MainTask(void) {
      16. GUI_Init();
      17. _DrawSomething();
      18. _ExportToFile();
      19. }
      Display All
      I hope this helps. If you have anymore questions, please let me know.

      Best regards,

      Florian