LCD Creator for Mac OSX

Thread Starter

portreathbeach

Joined Mar 7, 2010
143
After searching the web for some software for creating C code arrays for graphical LCDs for the Mac and finding none, I decided to have a go at writing my own.

It is written mainly for exporting code for use with a Nokia 5110 LCD module, but may work for other LCDs. I haven't actually experimented with my LCD module yet, but the exported C array should work if using horizontal addressing mode on the LCD.

Anyway, here's a screen shot and a link to download the software.




http://www.csmithsoftware.com/LCD_Creator/LCD_Creator.dmg


This is my first attempt, and any comments about improvement are welcome.
 

THE_RB

Joined Feb 11, 2008
5,438
I would add two edit boxes to allow the user to input X and Y offset.

That lets them import a smaller image (or icon etc) and position it on the display. Or centre a Logo image that is smaller than the display size.

And the option to invert the bitmap.
:)
 

Thread Starter

portreathbeach

Joined Mar 7, 2010
143
Hi,

I'll have a look into this. I did expect that if someone wanted a centred image, they would make the bitmap to the size of their screen with the image where they want it.

I was trying to keep it pretty simple, so if you load a small bitmap into the program, it generates a smaller C array, so not needing to load the entire screen, just a small part of it with the offset coded into the compiler, maybe good for making icons, fonts and possibly sprites for a game.

The 'invert' option would be pretty easy to implement.

Thanks for the comment, I'll have a play with my Nokia 5110 module and see what else I can come up with. :)
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Back when I was dong B&W displays I had two vital structures: bitmaps and fonts. Note this was for the C18 compiler which makes strong distinctions between RAM and ROM variables.

My bitmap starts as defined as yours seems to be: a contiguous stream of 1's and 0's that fill the area; at most there would be 7 unused bits in the last byte. But mine also adds width and height information as it is the rare exception I wanted to paint the entire screen. Mostly I would be doing buttons or other icons, so I used the following structure:

Rich (BB code):
typedef struct
{
    rom char bmpWidth;           // width in pixels
    rom char bmpHeight;          // height in pixels
    rom char *bitsBitmap;        // first byte of ROM bitmap 
} rom_bitmap;
Since there are no defined letters you need create your own. Fonts were defined similar to bitmaps except each letter was it's own individual bitmap to make parsing the letter bitmap array easier:
Rich (BB code):
typedef struct
{
    const rom char FirstFont;            // first ASCII symbol defined
    const rom char LastFont;             // last ASCII symbol defined
    const rom char DefaultFont;          // If nothing available...
    const rom char FontWidth;            // font width in pixels
    const rom char FontHeight;           // font height in pixels
    const rom char BytesPerCharacter;    // bytecount for a single character
    const rom char *Bitmap;              // first byte of ROM bitmap 
} font;
I don't have any examples of bitmaps handy, but here are the fonts as I used them.
 

Attachments

Thread Starter

portreathbeach

Joined Mar 7, 2010
143
Hi, The_RB. You can load any size bitmap into the software and it will output the C array. I've tried up to 640x480, which took about 5 seconds to create the array. In theory, any size can be used, just depends how long you want to wait for the conversion to take.
 

Thread Starter

portreathbeach

Joined Mar 7, 2010
143
Just a little update. As I am getting a 1.8" TTF RGB module, I decided to add a couple of extra options to LCD Creator.

You can choose from:

- Nokia 5110 (which outputs for horizontal addressing)
- ST7735 (1 bit per pixel) (vertical addressing)
- ST7735 (16 bit) (vertical addressed 16 bit RGB565 colour)


Haven't got my colour module yet, but in theory it will work.



The download is in a thread above.
 
Top