Hi I am trying to draw an icon to the emonGLCD display using the GLCD_ST7565::drawBitmap function in the glcdlib. I have this icon in an .xbm format currently as you can open it in an editor and copy the byte array etc. However this does not produce the desired result. I am guessing this is because of indexing or encoding differences. Does anyone know an easy way to create an input to the function from an icon file of a given size?
Think I may have found the answer on the old forums:
Sorry, I’ve never experimented drawing bitmaps on the GLCD.
Just to be clear, in the end I used the Bitmap Converter/LCD Assisstant available here: http://en.radzio.dxp.pl/bitmap_converter/ . The attached screenshot shows the settings that worked for the prepared bitmap. The process I followed was:
- Scale/draw base image in GIMP of correct pixel dimensions.
- Export as bitmap file.
- Open ‘Bitmap Converter’ and load bitmap file. Use the settings as in the following screenshot:
- File->Save to a text file the output.
- Open that file and copy the byte array.
It would probably be relatively easy to create Python script to take in bitmap file and spit out the byte array.