Bitmap drawing persistent failure

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

  • Bitmap drawing persistent failure

    Hi to all,
    I have a problem with bitmaps drawing.

    I'm developing from the Hello world project installed by STMCUBE application package
    (st.com/web/catalog/tools/FM147…ubemx_pron_prcube_feb2014)
    at this path
    C:\Users\XXXXX\STM32Cube\Repository\STM32Cube_FW_F4_V1.1.0\Projects\STM32F429I-Discovery\Applications\STemWin\STemWin_HelloWorld
    It's the STM32F429 discovery board basic example for STEMWIN.

    in file "BASIC_HelloWorld.c"
    I simply do this:

    C Source Code

    1. void MainTask(void) {
    2. volatile int retval;
    3. GUI_Clear();
    4. GUI_SetFont(&GUI_Font20_1);
    5. GUI_DispStringAt("Hello world!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);
    6. retval = GUI_BMP_Draw(&bmgenreicon,0,0);
    7. __nop(); //for debugger
    8. while(1);
    9. }
    Display All


    where bmgenreicon has been created with BmpCvt.exe
    I also tried to take bitmaps from other Discovery demonstrations with no success.
    I tried to increase RAM memory with no success.
    Image stats are following:

    C Source Code

    1. GUI_CONST_STORAGE GUI_BITMAP bmgenreicon = {
    2. 27, /* XSize */
    3. 23, /* YSize */
    4. 108, /* BytesPerLine */
    5. 32, /* BitsPerPixel */
    6. (unsigned char *)acgenreicon, /* Pointer to picture data */
    7. NULL /* Pointer to palette */
    8. ,GUI_DRAW_BMP8888
    9. };


    so it fits in the screen.

    I see that GUI_BMP_Draw has no effect and retval =1 that corresponds to failure.
    In documentation there are no clues on failure reasons.
    Can someone tell me what's wrong in this example?

    Thank you!!!
  • Hello,

    Please note that Bitmap does not equal BMP. Images stored as c file bitmap using the Bitmap Converter should be displayed using e.g. the function GUI_DrawBitmap(). Details about the bitmap formats which can be displayed using emWin can be found in the chapters "2-D Graphic Library" and "Displaying bitmap files" in the emWin user manual.

    Best regards,
    Adrian
  • Thank you Adrian,
    but I'm not displaying a raw BMP file. I already converted it in a .c sorce file and then I included it in my project.
    I tried many formats and I also tried to used already converted bMP to source file, taken from your example.
    No way to see something on screen, Function always returns error.
    Can you help me?

    Thank you
  • Hello,

    Yes, of course you are not using a BMP file, but you are using the function GUI_BMP_Draw() which can only be used to display BMP files.

    Please note my last post:
    Images stored as c file bitmap using the Bitmap Converter should be displayed using e.g. the function GUI_DrawBitmap().

    Best regards,
    Adrian