Main Site Documentation

Graphical 3.6


#1

Is it possible to create custom characters on this display?
I need ³ (small 3) to indicate cubic meter for example.

I looked at the driver, but I’m clueless as from where the mappings are coming:


static byte[] gylph_reg = new byte[129 * 5]
  {
    .
    .
    .
    0x36,0x49,0x49,0x49,0x36, /* 8 */
    0x06,0x49,0x49,0x29,0x1e, /* 9 */
    0x00,0x36,0x36,0x00,0x00, /* : */
    0x00,0x56,0x36,0x00,0x00, /* ; */
    .
    .
    .
  };


#2

Already done! There is 2 fonts in this file and you can modify to add more fonts http://www.tinyclr.com/downloads/Extension/GHIElectronics.Graphics.Simple128x64.cs


#3

Gus, I know there are 2 fonts in the driver, but it’s missing the character ³
I would like to add it, but to do that i need to understand the mappings.

for example, 8 = 0x36,0x49,0x49,0x49,0x36 (where is that coming from?)

Greetings


#4

I see, convert the numbers to binary using a calculator and then put the number on a piece of paper and you will see the 8. This is basically a binary bitmap of each character. A zero means no pixel and a one is a painted pixel


#5

I have a 16x16 bit map blit function…

  
public void Image(int x, int y, int Graphic)
        {
            int offset = Graphic * 2;
            for( int y1 = 0 ;y1<16; y1++)
            {
                Paint8Pixles(x , y + y1, Lcdgraphics[offset]);
                Paint8Pixles(x + 8, y + y1, Lcdgraphics[offset+1]);
                offset += 36;
            }    
        }

And I store my bitmaps as binary data (just like the glyphs


static byte[] Lcdgraphics = new byte[36 * 16]{	
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
            0x00,0x00,0x07,0xE0,0x07,0xE0,0x07,0xE0,0x07,0xE0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x1F,0xF8,0x1F,0xF8,0x1F,0xF8,0x1F,0xF8,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,
            0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0x7C,0x00,0x7C,0x00,0x7C,0x00,0x7C,0x00,
            0x7C,0x00,0x2C,0xFC,0x3F,0x3C,0x3F,0xFC,0x3F,0xFC,0x2F,0xF4,0x2F,0xF4,0x2F,0xF4,0x2F,0xF4,
            0x80,0x02,0x80,0x02,0x80,0x02,0x80,0x02,0x80,0x02,0x54,0x00,0x54,0x00,0x54,0x00,0x54,0x00,
            0x54,0x06,0x73,0xFE,0x7F,0xEC,0x7F,0xFE,0x7F,0xFE,0x5F,0xFA,0x5E,0x7A,0x59,0x9A,0x5F,0xFA,
            0x80,0x03,0xB0,0x03,0xB6,0x03,0xB6,0xC3,0xB6,0xDB,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,
            0x38,0x06,0x6F,0xFE,0x7F,0xF6,0x7F,0xFE,0x7F,0xFE,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xBF,0xFD,
            0x80,0x03,0xB0,0x03,0xB6,0x03,0xB6,0xC3,0xB6,0xDB,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x30,
            0x10,0x36,0xEF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xB4,0x4D,
            0x80,0x03,0xB0,0x03,0xB6,0x03,0xB6,0xC3,0xB6,0xDB,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x30,
            0x10,0x36,0xDE,0x7F,0xF7,0xEB,0xF7,0x7F,0xF7,0x7F,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xAA,0xD5,
            0x80,0x02,0x80,0x02,0x80,0x02,0x80,0x02,0x80,0x02,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0xB0,
            0x01,0xB6,0xDC,0xBF,0xFD,0xCB,0xFD,0xBF,0xFD,0xBF,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xAA,0xD5,
            0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0xB0,
            0x01,0xB6,0xFD,0xBF,0xFD,0xBF,0xFD,0xCB,0xDC,0xBF,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xA2,0xC5,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0D,0x80,0x0D,0xB0,
            0x0D,0xB6,0xFE,0x7F,0xFE,0x7F,0xFE,0x7B,0xDE,0x7F,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xAA,0xD5,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0D,0x80,0x0D,0xB0,
            0x0D,0xB6,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0x7F,0xFF,0xBF,0xFD,0xBF,0xFD,0xBF,0xFD,0xAA,0xCD,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x7F,0xFE,0x7F,0xFE,0x7F,0xF6,0x6F,0xFE,0xBF,0xFD,0xBE,0x7D,0xB9,0x9D,0xBF,0xFD,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x7F,0xFE,0x7F,0xFC,0x7F,0xCE,0x7C,0xFE,0x5F,0xFA,0x5E,0x7A,0x59,0x9A,0x5F,0xFA,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x3F,0xFC,0x3F,0xFC,0x3F,0x3C,0x3C,0xFC,0x2F,0xF4,0x2F,0xF4,0x2F,0xF4,0x2F,0xF4,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x1F,0xF8,0x1F,0xF8,0x1F,0xF8,0x1F,0xF8,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
            0x00,0x00,0x07,0xE0,0x07,0xE0,0x07,0xE0,0x07,0xE0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0
               
};

16 graphics in two lines the next two rows etc… of an overall picture mine is 512x16
all in a row.

Cheers Ian


#6

Ok, thanks guys, I managed to do what I wanted.