Friday, February 23rd 2018, 5:40am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

FSPD

Beginner

Date of registration: Mar 20th 2014

Posts: 15

1

Friday, June 13th 2014, 4:32pm

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
(http://www.st.com/web/catalog/tools/FM14…_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/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
void MainTask(void) {
  volatile int retval;
  GUI_Clear();
  GUI_SetFont(&GUI_Font20_1);
  GUI_DispStringAt("Hello world!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);

  retval = GUI_BMP_Draw(&bmgenreicon,0,0);
  __nop();      //for debugger
    
  while(1);
}


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/C++ Source code

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


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!!!

Date of registration: May 26th 2009

Posts: 1,022

2

Monday, June 16th 2014, 10:24am

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

FSPD

Beginner

Date of registration: Mar 20th 2014

Posts: 15

3

Monday, June 16th 2014, 1:08pm

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

Date of registration: May 26th 2009

Posts: 1,022

4

Tuesday, June 17th 2014, 9:24am

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:

Quoted

Images stored as c file bitmap using the Bitmap Converter should be displayed using e.g. the function GUI_DrawBitmap().

Best regards,
Adrian

FSPD

Beginner

Date of registration: Mar 20th 2014

Posts: 15

5

Tuesday, June 17th 2014, 9:26am

Hi Adrian,
I didn't adviced that there were such different functions! I immediately make a try and I let you know

FSPD

Beginner

Date of registration: Mar 20th 2014

Posts: 15

6

Tuesday, June 17th 2014, 9:31am

(solved)

Thank you Adrian, that was the problem!
Now it works