Arduino openGLCD Library Version v1.0rc2 |

All Classes Functions Variables Enumerations Enumerator Groups Pages
Using Bitmaps

You can use the distributed bitmaps or create your own.

There are two utilities located in bitmaps/utils to convert bitmap files to files that can be used by your sketch.

- bmp2glcd
- glcdMakeBitmap

bmp2glcd is a commandline tool.

glcdMakeBitmap is a utility written in the Processing language; However, a java version of the utilty is also provided.

glcdMakeBitmap converts a gif, jpg, bmp, tga or png file to a header file that can be used by your sketch.

The Processing file glcdMakeBitmap.pde located in the glcdMakeBitmap subdirectory runs in the Processing environment on your computer - its not an Arduino sketch. See: http://processing.org/

The java runtime (glcdMakeBitmap.jar) and java source (glcdMakeBitmap.java) are located in the Java subdirectory.

Run glcdMakeBitmap by either running the java jar file directly or loading the pde file into Processing.

Drop the image file to be converted into the window. If the image can be converted, the image will be displayed in the window and a header file is created in the bitmaps directory. For example, if the image file name to be converted is named image.bmp, the header is named image.h

To use the newly created bitmap, the aggregate header file (named allBitmaps.h) must be updated. Add the following line to to the allbitmaps.h header file in the bitmaps directory:

#include "image.h"

Alternatively, glcdMakeBitmap can also update the aggregate header file automatically. To update allBitmaps.h to include all header files in the bitmap directory, click the window.

Once the allbitmaps.h header has been updated, the sketch can display the image using the following code:

GLCD.DrawBitmap(image, x, y);

where x and y are the desired location of the upper left edge of the bitmap.

Note
  Do not include the bitmap header in the sketch.

## Bitmap Data Storage

Images are stored in program memory, a 128x64 pixel image takes 1k bytes of flash. Bear in mind that each different image used in a sketch will reduce the amount of code in a sketch. The glcdMakeBitmap displays the amount of memory required for the image and other useful information when it does the conversion.