GUI Builder generated files occuping more memory on PIC32MZ devices

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

    • GUI Builder generated files occuping more memory on PIC32MZ devices

      hi all,

      Currently i'm working on project with MPLAB IDE to develope GUI application and using Segger emwin Guilder to generate the screens. In segger emwin library which is available in MPLAB IDE, Button widget is only supporting bitmap images. i'm using bitmap converter application to generate source code for ICONs. The problem is bitmap images are consuming more memory. in my GUI application i have almost 30 screens to be implemented.i'm using PIC32MZ2025DAG176 controller which is having 2025KB of flash(about 99% of memory is consumed) and 32MB size of internal DDR(frame buffer). but for 5 screens only the complete memory is occupied. and as i observed JPEG images are consuming less memory tha bitmap images. but in segger library which is available in MPLAB IDE is not supporting any other format except bitmap for button widget.

      can you please help me to get out of this problem. thanks in advance.


      Regards
      MMK
    • Hi,

      What should be drawn on the button?

      If those buttons are just plain with a simple drawing you might try our alpha bitmaps. These bitmaps contain only the alpha information compressed with RLE. Also, it is possible to change the color of the drawing on runtime.
      Just choose the option 'Alpha channel, compressed' when saving the image. Of course, this works only when the image is quite simple.

      You can also use JPEGs converted into a c-array and use them on your button. This it is not possible to simply set a JPEG for button you have to overwrite the callback function of a button.

      Attached is an example on how this could be done. I have created a structure which contains two pointers to a JPEG for pressed and one for unpressed state as well as the size of those JPEGs.

      In the callback function of the buttons I use their IDs to calculate an index. With this index and the state of the button I acces the structure for selecting the proper JPEG.

      In the example I use the same images for both buttons, but it should give you an idea on how it could be done.

      Regards,
      Sven
      Files
    • New

      Thanks for reply Sven,

      i have tested with JPEG image on button. it is working fine. And yesterday i just tried to see all image formats based on size. i found that PNG format is good(memory size is very less) comapare to remaing image formats(BMP and JPEG) based on image size. is this possible to set PNG images on button? if yes please let me know the process.

      Thanks in advance.


      Regards
      MMK
    • New

      Hi,

      To use PNGs on the button you should do it the same way as with JPEGs.

      You can only use Bitmaps (those generated with the BitmapConverter) and BMP files with the BUTTON API.

      To be able to use PNGs you have to download the PNG package and add it to your project (of course, just the folder which fits to your emWin version).
      This package can be downloaded here:
      segger.com/downloads/emwin/emWin_PNG

      Regards,
      Sven