CCS with Image Reformer
Image Reformer is decades-old software. For a modern, more intuitive alternative, take a look at JSFormer.
You can find a complete video guide here.
Image reformer is a tool from Texas Instrument which converts image files (.png, .bmp, .jpg etc) into C files that can be imported in a CCS project and displayed on the onboard LCD display.
Follow this link to download and install the executable. If you have difficulty with the TI website, please use this file.
Steps to convert an image into C file
Open the image reformer tool.
Click on File -> Open
Navigate to the folder containing the image to use and double click on the image file.
To avoid issues later on, it is strongly recommend to rename the image file to get rid of spaces and hyphens. If you have an image called "Basic Game Tile.jpg" or "basic-game-tile.jpg", consider renaming it to "BasicGameTile.jpg". An alternative may be "Basic_Game_Tile.jpg", but Pascal case or camel case is the simplest to work with and less prone to issues. Your mileage may vary.
The following screen would show up
Use the middle buttons to select the color representation of the output image. 2 Color represents grayscale. For small icons, 256 Color shouldn’t be a problem. For larger images, 16 Color would be a better choice.
Sometimes, your converted image may be completely blank or very different from the original. Oftentimes, transparency can cause issues. Consider experimenting with other file formats (such as ones that don't support transparency like JPEG), other color options, or different image dimensions/sizes.
Use the highlighted fields to adjust the width and height of the output image. The LCD display on the board supports up to 128x128.
To generate the output C file, click on File -> Generate. Select a file name and a directory and save the generated file. You can either directly put it in your CCS project folder or save it somewhere else and move it there later. It is your choice. If you like to save it directly to your project but you are not sure the location of the project on the disk, here is how to find your project location:
Right-click on the name of your project inside CCS in the project explorer window.
Click on "Show In" from the shown drop-down menu.
Choose "System Explorer" from the yet another drop-down menu that is shown.
This opens the system explorer where you can see the location of your project on the top.
Steps to import the generated C image file and display
Open the CCS project where you want to display the image. Open the newly generated file. Sometimes it takes a few minutes for this file to show up in Project Expolorer when you add it from outside CCS. On top of the file, after a big comment block, you should see this line:
#include "grlib.h"
Modify the line to look like below:
#include <ti/grlib/grlib.h>
Scroll to the end of the file and locate the name of the image object. Copy that name. In the below example, the name of the image object is colors8BPP_UNCOMP and is highlighted in yellow.
Go to the file where your main function is and on top of the file, include the image by making it an extern object. In our example, it will look like this:
extern const Graphics_Image colors8BPP_UNCOMP;
To draw the image on the LCD display, use the function Graphics_drawImage. Pass the graphics context, image object, x location and y location as inputs to this function. In our Guess the Color code where the graphics context is part of the HAL structure, the code to draw the image at the top left corner of the display looks like this:
Graphics_drawImage(&hal_p->gfx.context, &colors8BPP_UNCOMP, 0, 0);
Creating icons and .png files
The website www.xiconeditor.com provides an easy interface to create icons(.ico file).
Use any online tool to convert the .ico file into .png file.
Refer to the above sections to use this .png file in your CCS project.