Custom background image in emWin simulation?

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

  • Custom background image in emWin simulation?

    Hi,

    I'm trying to use a custom background image linked to the application as a win32 resource with the precompiled simulation library. The manual tells me that this should be possible. So far I couldn't find out what to do to include my custom bitmaps as resources into the application.

    My resource file contains:

    IDB_DEVICE BITMAP DISCARDABLE "Device.bmp"
    IDB_DEVICE1 BITMAP DISCARDABLE "Device1.bmp"

    The VS project contains the respective bitmap files.

    Still it does not work. Any hints?

    Regards,
    Florian.
  • Dear Florian,

    Could you please tell me exactly what is not working? emWin contains several functions to draw bitmap files. Since I do not know which way you would like to go, I would suggest to have a look at the following sections of the emWin documentation:
    • "Drawing bitmaps" in chapter "2-D Graphic Library"
    • "BMP file support" in chapter "Displaying bitmap files"
    • "Generating C files from bitmaps" in chapter "Bitmap Converter"
    You can also refer to the tutorial file 2DGL_DrawBMP.c. The contained application shows how to display the bitmap files which are located in the windows folder.

    Please let me know if you still experience trouble.

    Best regards,
    Adrian
  • Hi Adrian,

    it's not about drawing bitmaps on the display. I want to use a custom device bitmap (picture of the to-be-developed product front) in the simulation embedded into the simulation executable as Windows resources. Currently it's only possible to use custom device bitmaps that are available as Device.bmp, Device1.bmp files in the working folder of the simulation executable.

    Regards,
    Florian.
  • Dear Florian,

    Of course it is possible to use custom bitmaps. You just have to call SIM_GUI_UseCustomBitmaps() from within SIM_X_Config(), which is located in SIMConf.c. After you have done this, the images Device.bmp and Device1.bmp are used as Device and HardKey images.

    For further information about using the simulation, please refer to the chapter "Simulation" in the emWin documentation.

    Best regards,
    Adrian
  • Dear Adrian,

    thanks for your help, but that's not the problem. I indeed can use custom bitmaps that are available as .bmp files in the current working directory of my simulation executable. What I'm looking for is the possibility to embed these .bmp files as windows resources in my application executable in order to reduce the number of files composing my simulation to a single exe file. This is mentioned in the manual but doesn't work with my simulation.

    Regards,
    Florian.
  • Dear Florian,

    I am sorry for the delay. I was occupied by the trade fair in Nuremberg.

    The bitmaps Device.bmp and Device1.bmp are embedded as resources in the simulation. How is that you think that they are not? I must admit that I do not really understand what you are aiming to.

    Best regards,
    Adrian
  • Dear Adrian,

    in the manual I have (UM03001_emWin5.pdf, Version 5.04, Manual Rev. 0) on pg #39 chapter "3.2.2 Custom bitmap view" states "The bitmap [...] may be a separate file (in the same directory as the executable), or it may be included as a resource in the application".

    On the same page further down subchapter "Adding the bitmap to the application resources" is explaining how to embed the .bmp files as windows resources into the application executable.

    I understand that they can be linked to the application .exe file and therefore don't need to exist in the executable working directory any longer as separate .bmp files.

    Florian.
  • Dear Florian,

    You are right. Both ways of including device bitmaps are possible, but the resource bitmaps are always embedded. External bitmaps are only used, if they are found in the same folder the executable is located in.

    I would suspect the according include path to be missing in your project settings. Maybe it would be a good idea to have a look at your project. Could you please check the project settings once again and then send me a small example project which shows the problem? You can send it to support@segger.com.

    Thank you in advance.

    Best regards,
    Adrian