µTasker Forum

µTasker Forum => µTasker general => Topic started by: hervé on April 13, 2012, 03:56:54 PM

Title: LCD_WEB_INTERFACE
Post by: hervé on April 13, 2012, 03:56:54 PM
Hi MArk,



Regards
Title: Re: LCD_WEB_INTERFACE
Post by: mark on April 14, 2012, 08:45:25 PM
Hi Hervé

1) The header is a standard BMP so the details about this can be found at at Microsoft's web site (MSDN). This however only defines the content (how many colours etc.)
The actual pixel content is defined in the content itself and how this is done depends on the display type - if the display is using 24 bit colour it is read from the display and inserted - for example:

                    ulPixel = *ET024006_PARAM_ADDR;                      // read the red content
                    cValue[x + 2] = (unsigned char)(ulPixel);
                    ulPixel = *ET024006_PARAM_ADDR;                      // read the green content
                    cValue[x + 1] = (unsigned char)(ulPixel);
                    ulPixel = *ET024006_PARAM_ADDR;                      // read the blue content
                    cValue[ x ]   = (unsigned char)(ulPixel);


For monochrome displays that should be displayed as two colours this is defined at (for example, because it is not identical for all display types):

                        cValue[x + 2] = (unsigned char)(LCD_PIXEL_COLOUR);
                        cValue[x + 1] = (unsigned char)(LCD_PIXEL_COLOUR >> 8 );
                        cValue[ x ]   = (unsigned char)(LCD_PIXEL_COLOUR >> 16);


and

                        cValue[x + 2] = (unsigned char)(LCD_ON_COLOUR);
                        cValue[x + 1] = (unsigned char)(LCD_ON_COLOUR >> 8 );
                        cValue[ x ]   = (unsigned char)(LCD_ON_COLOUR >> 16);


To change the two colours that are displayed you can therefore modify the colour defines in config.h

   #define LCD_ON_COLOUR          (COLORREF)RGB(60,220,60)              // RGB colour of LCD when backlight is on
    #define LCD_PIXEL_COLOUR       (COLORREF)RGB(0,0,0)                  // RGB colour of LCD pixels


The format is the standard RGB - so red will be (255, 0, 0) and black (0, 0, 0)


2) Since the embedded file collection overloads the default files you will need to put the favicon.ico and LCD.BMP in your embedded files - you can remove them from the code if they are not required as defaults.

Regards

Mark


Title: Re: LCD_WEB_INTERFACE
Post by: hervé on April 18, 2012, 09:35:09 AM
Hi Mark,

Thanks for informations,

In fact former, I tried to change LCD_PIXEL_COLOUR  and LCD_ON_COLOUR  but it did not work.

I found that there is a mismatch on my defines, because :

#define RGB(r,g,b)              (COLORREF)(((b << 4) & 0x0f00) | (g & 0x00f0) | (r >> 4))

But on fnInsertString() :
                        cValue[x + 2] = (unsigned char)(LCD_ON_COLOUR);
                        cValue[x + 1] = (unsigned char)(LCD_ON_COLOUR >> 8);
                        cValue

I change the definition of RGB and now it works fine.....