make memdev bigger than screen size

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

    • make memdev bigger than screen size

      Hi.

      I use the ver5.32 EMWIN as STM32F429 board in 240x320 TFT-LCD.

      I referred to following URL and I succeed to work this project.
      wiki.segger.com/WM_MOTION_-_Move_content_(Sample)

      I made popup window above main window. and use GUI_MEMDEV_WriteAt by window callback after draw PNG image on MEMDEV size of 200x500 at popup window
      it works have some problem little bit, i wanted to draw 200x500 scrollable setting menu but it works 200x300 (max y screen size). images over y 300 is filled gray color.
      i think it is cut over the screen size and can i use memdev bigger than screen size?

      Thanks.
      Images
      • fail setting menu.jpg

        188.81 kB, 500×640, viewed 427 times
      • setting menu.jpg

        179.48 kB, 500×616, viewed 427 times
    • Hi,

      yes, this is a known issue and is already addressed. The reason is the clipping rectangle clipping the drawing into the memory device.

      With the latest emWin version we have introduced a function to get around this.

      You might try to temporarily increase the window size to the size of the memory device before drawing into the device. After filling the device restore the window to its intended size.

      Try this before writing to the memory device:

      C Source Code

      1. //
      2. // Rescue some values
      3. //
      4. xSizeOrg = WM_GetWindowSizeX(hWin);
      5. ySizeOrg = WM_GetWindowSizeY(hWin);
      6. xPosOrg = WM_GetWindowOrgX(hWin);
      7. yPosOrg = WM_GetWindowOrgY(hWin);
      8. WM_SetWindowPos(hWin, 0, 0, xSizeTemp, ySizeTemp);
      9. GUI_pContext->xOff = 0; // Offset needs to be set manually. This requires GUI_Private.h to be included
      10. GUI_pContext->yOff = 0; // Offset needs to be set manually. This requires GUI_Private.h to be included
      11. //
      12. // Write something to the memory device
      13. //
      14. DrawIntoDevice();
      15. //
      16. // Restore initial values
      17. //
      18. WM_SetWindowPos(hWin, xPosOrg, yPosOrg, xSizeOrg, ySizeOrg);
      19. GUI_pContext->xOff = xPosOrg; // Restore offset
      20. GUI_pContext->yOff = yPosOrg; // Restore offset
      Display All


      Depending on the library you are using it might be possible that you don't have access to GUI_pContext. In this case there is not much you can do except trying to get access to the latest version.

      Regards,
      Sven
      Please 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.