Importing Images Into an MLA Graphics Project
Summary
This article shows how to use the Graphics Resource Converter (GRC) to import fonts into a Graphics project based on MLA. This tutorial places the imported font into program memory.
Starting the GRC Utility
The GRC is located in the MLA Installation directory:
…microchip/mla/vYYYY-MM-DD/framework/gfx/utilities/grc
Linux® and macOS X® users launch the resource converter by executing grc.jar, and Microsoft® Windows® users invoke it by executing launch_grc.bat.
Configuring the GRC
From the GRC user interface, select Project then Settings.
- For this example configure the GRC to place imported images into internal program memory (internal Flash).
- Set the Graphics Module Bits per pixel to 16 (16 bpp).
- When working with PIC® MCUs which have an internal graphics module, such as the PIC24FDA series, the Graphics Module option can be selected to set the image format.
- After configuring the GRC select OK
Starting the Import Process
To begin importing an image, select File then Add Images.
Selecting the Image to Import
After selecting Add Image, you will be directed to browse and locate either a bitmap or a JPEG image to import into the project. Select the file, then press Open.
Convert the Image
When you have finished selecting the images you wish to import, select Project then Convert.
Include the C code and Header file in the MPLAB X Project
The conversion process creates an assembly file (.s), a C file (.c), and a header file (.h) for each imported image. These files need to be included in the MLA Graphics project just as all other source files and header files.
The image on the right shows the files for the image NewImage.bmp included in a project which were saved in files with the name of NewImage.*. The three files created are:
- NewImage.s
- NewImage.h
- NewImage_reference.c
All three of these files are added to the project tree automatically by the GRC.
Build the Project
Re-building the project after adding the new image's header and source files makes the image available for use.