GUI_BMP_SerializeExBpp() does not capture all items of specified screen range

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • GUI_BMP_SerializeExBpp() does not capture all items of specified screen range

      Hello,

      as described in my last post I want to display a spectrogram window which gets filled row by row from the bottom and shifted out on the top. This works with below code by a window which is invalidated regularly for redrawing and a PAINT callback which shifts the window content 1 row up and adds a new row.
      Now I want to save the screen content in a file using GUI_BMP_SerializeExBpp(). This produces strange results as shown in the two pictures below. In the first picture the full spectrogram window appears in the bitmap but the other widgets are missing. In the second picture I reduced the width of the spectrogram from 800 to 200 pixels. It can be seen that all other widgets also appear in the bitmap as intended. To me it looks like a memory issue. What could I do to fix the problem?

      Best regards
      Jan

      C Source Code

      1. case WM_INIT_DIALOG:
      2. hItem5 = WM_CreateWindow(0, 95, XSIZE_PHYS, 350, WM_CF_SHOW, _cbWinSpectrogr, 0); /*create spectrogram window with callback*/
      3. WM_CreateTimer(pMsg->hWin, 0, 50, 0); /*timer for periodic refresh*/
      4. break;
      5. case WM_TIMER:
      6. GUI_RECT Rect = {0, 0, XSIZE_PHYS, 350};
      7. WM_InvalidateRect(hItem5, &Rect); /*trigger redrawing of the spectrogram*/
      8. WM_RestartTimer(pMsg->Data.v, 200);
      9. break;

      C Source Code

      1. /*callback for the spectrogram window*/
      2. static void _cbWinSpectrogr(WM_MESSAGE * pMsg)
      3. {
      4. switch (pMsg->MsgId)
      5. {
      6. case WM_PAINT:
      7. {
      8. GUI_CopyRect(0, 1, 0, 0, XSIZE_PHYS, 350); /*copy the previous window content and insert it 1 row up*/
      9. for (uint16_t n = 0; n < XSIZE_PHYS; n++)
      10. {
      11. GUI_SetColor(FFT_SpectrogrColor[(GraphOut[FFT_WaterfallCh][n]) * 70 / (uint16_t)FFTVerSize]);
      12. GUI_DrawPixel(n, 349); /*draw a new spectrogram row at the bottom of the window*/
      13. }
      14. }
      15. break;
      16. default:
      17. WM_DefaultProc(pMsg);
      18. break;
      19. }
      20. }
      Display All



      The post was edited 2 times, last by JanBurg ().