Author Topic: LCD_WEB_INTERFACE  (Read 2934 times)

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
LCD_WEB_INTERFACE
« on: April 13, 2012, 03:56:54 PM »
Hi MArk,

  • 1/ I plan to use the Lcd.bmp view from the web browser.
    How can I change the color displayed (black/red) .
    in W_BITMAPINFO or W_BITMAPHEADER ? Do you have some documentation ?....
  • 2/ As I will always have the "favicon.ico" and "LCD.BMP" available, how can I manage to have the "static const USER_FILE user_files[]" use and then the one uploaded by ftp

    Is it possible or do I have to include those files in mines ?


Regards

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: LCD_WEB_INTERFACE
« Reply #1 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


« Last Edit: April 15, 2012, 08:23:44 PM by mark »

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: LCD_WEB_INTERFACE
« Reply #2 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
  •      = (unsigned char)(LCD_ON_COLOUR >> 16);


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