This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

The Widget does not draw Images

I tested my new GLCD with ILI9320 controller and SPI interface.

All the primitive functions of the grlib.h, including  GrImageDraw(..); works fine, colors are drawn correctly,but when I try to upload the image to the Widget using a style  xxx_STYLE_IMG, Widget absolutely not draw and I do not see anything on the display.

The Widget without images is working fine.

For example:

//This Widget is working normally

RectangularButton(g_sPushBtn, &g_sBackground, 0,0, &g_sHY28A_SPI_ILI9320, 100, 200,

                  50, 50, PB_STYLE_OUTLINE  | PB_STYLE_TEXT , 0, 0, ClrRed,

                  ClrSilver, g_pFontCm20, "TEST", 0, 0, 0, 0, 0);

// the same edited Widget with code below, I see only red outline on the display, no text, no image…

RectangularButton(g_sPushBtn, &g_sBackground, 0, 0, &g_sHY28A_SPI_ILI9320, 100, 200,

                  50, 50, PB_STYLE_OUTLINE|PB_STYLE_TEXT|PB_STYLE_IMG , 0, 0, ClrRed,

                  ClrSilver, g_pFontCm20, "TEST", g_pucBlue50x50,

                  0, 0, 0, 0);

The same thing happens with the other Widget’s: Canvas, RadioButton… and similar

(g_pucBlue50x50 is  included in My_images.h)

 

//The primityve function below, image is a well-displayed:

GrImageDraw(&g_sContext, g_pucBlue50x50, 120,160);

 

btw I‘m using STELLARIS ® LM4F120 Launchpad,Code Composer Studio v5.2.1, and

StellarisWare 9453

Where could be my problem?

  • You don't tell us the size and format of the image you are using and that would be helpful. Even without this information, I would suggest the most likely cause for the problem is a bug in your graphics driver's PixelDrawMultiple function.  This is the most complex function in the driver and contains a lot of cases for different source pixel formats and different output alignments. Make sure you have tested every pixel format (1, 4 and 8 bpp, compressed and uncompressed images) and every horizontal pixel alignment (x coordinate modulo 8 taking all values from 0 to 7). I'll bet you find that the case corresponding to this particular image at the particular position that the widget is trying to draw it results in a problem.

    If that's not the problem, the only other thing that comes to mind may be a clipping issue if your image is larger than the widget you are trying to draw it into. That would tend to point to a bug in the widget paint function and we would have to look into that. If that's the case, I would definitely need information on the image size and format to allow us to reproduce the problem here.

  • I found my problem!!!

    Maybe it will be useful to others.

    The system stack size was too small (256).

    If  using grlib with widgets, is necessary increase the stack size.

    Go to the Project Properties>> ARM Linker ->> Basic Options and set C System Stack Size to 1024

    (Code Composer Studio v5.x.x)