emwin_png with stemwin: PNG without transparency

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

  • emwin_png with stemwin: PNG without transparency

    HI !
    I try to use the PNG-functions in combination with Stemwin (emwin 5.22) from emwin_png as described in PDF. Compilation works fine with lib files 5.18 and 5.26 (some warnings, no errors).
    Normal PNGs are shown correctly (IMAGE_SetPNG). Transparent PNGs are shown with black background where transparency should be. GIF with trans work fine.
    I use the code generated by the GuiBuilder. Inside the builder all pictures are o.k. On ST discovery board (STM32F429i) all PNGs with transparency have this black background.
    Win32-Simulation also works fine but the functions are already implemented in the win lib.
    Do I have to change some configuration settings to achieve this?
    Library *.a for arm F4 does not contain the png-functionality.
    Thanks!
  • Hello,

    Drawing a PNG image with transparency works with just one function call. Nothing needs to be configured in addition. Therefor to me this sounds like a memory problem. Does the memory configuration in your simulation project equal the memory configuration in your target project?

    If not, please try to upsize the memory area which is assigned to emWin in GUIConf.c.

    If yes, I would assume this is a hardware related problem. In this case I would recommend requesting support at ST.

    Best regards,
    Adrian
  • Hello Adrian !

    I will check the settings but that should not be the problem. I started from the segger demo with F429i-Discovery.
    After GUI_Init the windowdialog.c starts instead of segger demo with only one small PNG from GUI builder 5.22.
    Do I have to convert the PNG with BMPconvert instead? With alpha? Or use Memdev (auto)?
    Could it be the read back routine (device driver)?
    I was able to generate transparent dialogs and the demo also runs whithout problems.
    Normal PNGs without transparency are shown whithout any problems. GIFs also work fine with or without transparency.
    There are some compiler warnings (GCC) when compiling the files inside emwin_png.zip. And there are only files for 5.18 and 5.26, not 5.24 (CubeF4) and 5.22 (stemwin 1.3).
    What other functions could be used to show PNG (or any other format with transparency)? GIF is always 256 colors.

    Is there a way to activate debug messages inside PNG-library?

    Best regards,
    HaJo
  • Hello HaJo,

    No, converting the PNG using the Bitmap Converter should not be required, but may be a help. emWin bitmaps can also take 24bpp + 8 bit alpha channel. In order to display more than 256 colors + transparency/Alpha Blending, the emWin bitmap or PNG format should be used.

    Memory Devices should not be required in order to make PNGs work.

    Yes, read back functionality might likely cause the problem.

    I found information on how to activate debug messages on line 2431 in png.h. Basically PNG_DEBUG needs to be defined for that.

    Best regards,
    Adrian
  • Hello HaJo,

    Thank you for the feedback.

    Since read back functionality often is an issue and controllers sometimes do not provide read back functionality at all, please note that this can be worked around by using a display driver cache. Most emWin display drivers can be configured to use a cache which would be read instead of trying to read data from the display controller.

    Best regards,
    Adrian