About GUI_PNG_Draw drawing a problem with transparent channel images

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

    • About GUI_PNG_Draw drawing a problem with transparent channel images

      Drawn using the GUI_PNG_Draw method, the transparent part of the image is actually not transparent,single-frame display is not very obvious, but multiple images with transparent parts are superimposed.

      Source Code

      1. GUI_SetBkColor(GUI_DARKMAGENTA);
      2. GUI_Clear();
      3. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 40);
      4. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 90);
      5. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 90);
      6. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 140);
      7. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 140);
      8. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 140);
      9. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 190);
      10. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 190);
      11. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 190);
      12. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 190);
      13. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 240);
      14. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 240);
      15. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 240);
      16. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 240);
      17. GUI_PNG_Draw(_accloudy, sizeof(_accloudy), 80, 240);
      Display All
    • Hi,

      I gave it a try, but on my end it looks good.

      Which version of emWin are you using?


      Ok, I got it, I didn't noticed that you were drawing the PNGs multiple times over each other.
      I was able to reproduce the behavior and fixed it. It will be included in the next emWin release.

      Thanks for the hint.


      Regards,
      Sven
    • SEGGER - Schoenen wrote:

      Hi,

      I gave it a try, but on my end it looks good.

      Which version of emWin are you using?


      Ok, I got it, I didn't noticed that you were drawing the PNGs multiple times over each other.
      I was able to reproduce the behavior and fixed it. It will be included in the next emWin release.

      Thanks for the hint.


      Regards,
      Sven
      Hi,
      The version I am using is V5.48. I understand it a bit now. I tested the overlay display in the default environment (single layer) without opacity, and the display effect is as follows.


      However, before I used two layers, the modifications were made in LCDConf.c and SIMConf.c as follows, and then opaque phenomenon will appear in layer1.

      Source Code

      1. #define COLOR_CONVERSION GUICC_888
      2. void LCD_X_Config(void) {
      3. GUI_SOFTLAYER_CONFIG aConfig[] = {
      4. { 0, 0, 1280, 480, 1 },
      5. { 0, 0, 1280, 480, 1 },
      6. };
      7. //
      8. // Set display driver and color conversion for 1st layer
      9. //
      10. GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
      11. //
      12. // Display driver configuration
      13. //
      14. LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
      15. LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS);
      16. LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
      17. //
      18. // SoftLayer activation after existing single layer configuration
      19. //
      20. GUI_SOFTLAYER_Enable(aConfig, GUI_COUNTOF(aConfig), GUI_DARKBLUE);
      21. }
      Display All

      Source Code

      1. void SIM_X_Config() {
      2. SIM_GUI_SetCompositeSize(1280, 480); // Set size of composite window
      3. SIM_GUI_SetTransMode(1, GUI_TRANSMODE_PIXELALPHA);
      4. SIM_GUI_SetTransMode(2, GUI_TRANSMODE_PIXELALPHA);
      5. SIM_GUI_ShowDevice(1);
      6. }




      In the MultiLayer / MultiDisplay support section, there is the following description: "The only available fixed palette modes including transparency (not Alpha Blending) are GUICC_M1555I and GUICC_8666_1.are GUICC_M1555I and GUICC_8666_1.", is it a problem with the picture format? Test the picture can see the following zip file.

      ------------------------------------------------------------------------cloudy.zip----------------------------------------------------------------------------------------------------------------------

      The post was edited 1 time, last by OpFancy ().