This article shows how to create monochrome icons / bitmaps to display on the LCD attached to the developer boards.
Since The GLIB pixmap format is not standard and additional plug-in has to be installed in GIMP (the plug-in is attached to this article). In GIMP Edit -> Preferences find the Plug-in folder and copy the attached GIMP plug-in to this directory then restart GIMP (on Linux the file attribute of the plug-in must be set to executable).
First create a new image, set the required size (width and height):
Edit the image - preferably use only black and white color as the color depth of the LCD display on the WSTK is 1 bit.
By default the color mode of the image is RGB for a newly created picture. This must be changed to indexed to be processable by the plugin thus change it: Image -> Mode -> Indexed.
Select Use black and white (1-bit) palette:
From File menu choose Export GLIB pixmap... to save the pixmap files:
Select the appropriate folder for the files (it is a good practice to create a directory in the Studio project to store the pixmaps and export the files to that folder directly) and choose a suitable name for the picture (don't add file extension it will be generated by the plug-in):
Press OK to save the C and header files - be careful, there is no confirmation the existing files will be overwritten.
The plug-in creates a file with .c extension which contains the actual image data and a file with extension .h containing two defines for the image width and height. Files, defines and the data array named based on the Output name. For example if the Output name is thermometer a header file named thermometer.h will be created containing THERMOMETER_WIDTH and THERMOMETER_HEIGHT defines and a C file named thermometer.c containing thermometer_bits array.
To use the pixmaps created with GIMP simply include the header file in the project, for example:
The header files must be in the include path - it may need to add the pixmap folder in project properties.
The created pixmap can be used by the GLIB_drawBitmap() GLIB API function:
GLIB_drawBitmap(&glibContext, 0, 0, THERMOMETER_WIDTH, THERMOMETER_HEIGHT, thermometer_bits);
For further reference of using GLIB library see the following knowledge base article: