Hi,
I'm new to emwin and I'm using STemwin on the STM32f429 discovery board.
I need to migrate a old project on emwin and to do this I have to use memory devices and manually handle screen redraw.
My problem is that if I use a memory device as drawing target I see that graphics are transferred directly to screen. And this before calling the GUI_MEMDEV_CopyToLCD() function.
Is there something I miss?
I started from the "hello-world" example for my board and I added the code of the layers transparency example modified with memory devices usage:
Display All
Thank you for your help
I'm new to emwin and I'm using STemwin on the STM32f429 discovery board.
I need to migrate a old project on emwin and to do this I have to use memory devices and manually handle screen redraw.
My problem is that if I use a memory device as drawing target I see that graphics are transferred directly to screen. And this before calling the GUI_MEMDEV_CopyToLCD() function.
Is there something I miss?
I started from the "hello-world" example for my board and I added the code of the layers transparency example modified with memory devices usage:
C Source Code
- //memdev handles creation
- GUI_MEMDEV_Handle hMem0,hMem1;
- //just to be sure layes are visible
- GUI_SetLayerVisEx(0,1);
- GUI_SetLayerVisEx(1,1);
- //first memory device on layer 0: these operations are not shown
- //but only because there's opaque layer 1 covering them
- GUI_SelectLayer(0);
- hMem0 = GUI_MEMDEV_Create(0, 0, 200, 100);
- //memdev selection
- GUI_MEMDEV_Select(hMem0);
- GUI_Clear();
- GUI_SetColor(GUI_RED);
- GUI_FillRect(0, 0, 199, 33);
- GUI_SetColor(GUI_GREEN);
- GUI_FillRect(0, 34, 199, 66);
- GUI_SetColor(GUI_BLUE);
- GUI_FillRect(0, 67, 199, 99);
- //second memory device on layer 1: these operations are shown suddently
- GUI_SelectLayer(1);
- hMem1 = GUI_MEMDEV_Create(0, 0, 200, 100);
- GUI_MEMDEV_Select(hMem1);
- GUI_SetBkColor(GUI_WHITE);
- GUI_Clear();
- GUI_SetColor(GUI_BLACK);
- GUI_DispStringHCenterAt("Layer 1", 100, 4);
- GUI_SetColor(GUI_TRANSPARENT);
- GUI_FillCircle(100, 50, 35);
- GUI_FillRect(10, 10, 40, 90);
- GUI_FillRect(160, 10, 190, 90);
- //memory devices copy in respective layers: this is unuseful
- //because all is already drawn on layers
- //I would like to see result only after these two steps
- GUI_MEMDEV_CopyToLCD(hMem0);
- GUI_MEMDEV_CopyToLCD(hMem1);
Thank you for your help