User manual

Software Examples
www.ti.com
3.3 BOOSTXL-K350QVG-S1 Graphics Library Example
This software is available in the MSPEXP432P401R Software Examples zip download, or more easily
accessible through MSPWare (see Section 4.3).
The demo shows how to use the MSP Graphics Library http://www.ti.com/tool/msp-grlib or “grlib,” in a
project with the Kentec display. This demo shows the user how to enable the touch screen, create
buttons, and use graphics primitives including colors and images.
The program begins by calibrating the touch screen. There is a routine that detects the four corner
coordinates to determine if an eligible rectangle boundary is formed. If the calibration was incorrect, a
message will display on the screen indicating the calibration failed. When successful, the calibration
provides a reference for all button presses throughout the rest of the program.
The next step is to select the mode of the program- display primitives or images. Each mode simply cycles
through without user interaction to show off features of the display. In the graphics primitives mode, the
following primitives are shown:
Pixels
Lines
Circles
Rectangles
Text
The application is heavily commented to ensure it is very clear how to use the grlib APIs. The above
primitives are shown as well as the underlying concepts of grlib including background and foreground
colors, context, fonts, opacity, and more.
The images mode shows the drawing of a few different images both compressed and uncompressed.
Image compression can have a big impact to drawing speeds for simple images. To draw images with the
MSP Graphics Library, they must first be converted into the right file format. These files can be generated
by the Image Reformer tool that comes packaged with grlib. Launch this tool from the grlib folder or direct
from TI Resource Explorer.
File Path: <grlib root>\utils\image-reformer\imagereformer.exe
TI Resource Explorer > MSPWare > Libraries > Graphics Library > MSP430 Image Reformer
The Image Reformer tool allows you to import images and output into grlib specific files to add to your
grlib project. Image Reformer does not manipulate any images (such as color modifications, rotation, or
cropping), any image manipulation must be done before importing into the Image Reformer tool. More
information about MSP grlib and the Image Reformer tool can be found in the Design Considerations
when Using MSP430 Graphics Library application note.
22
MSP
EXP432P401R LaunchPad™ Evaluation Kit SLAU597March 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated