Graphics Resource Converter
Contents | Index
Next

The Graphics Resource Converter converts images, bitmaps (BMP extension) and JPEG (JPG or JPEG extension), fonts, operating system's installed fonts or True Type fonts directly from files (TTF extension), binary files into formats to be used with Microchip Graphics Library. Bitmap and fonts are converted to a new optimized encoding for PIC microcontroller usage while the JPEG encoding of JPEG images are maintained. The converter can also be used to create color palettes used by Microchip's graphics module based upon GIMP palettes or bitmaps.

Fonts maybe a copyrighted material so please ensure that you have the rights to use it. You may find free fonts distributed under Open Font License (OFL) agreement. Some of the fonts distributed under OFL may be found here [image] http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=OFL_fonts.

Importing fonts into application can be performed in two ways. The first method is to identify a range of characters that you want to use and create a font table starting from the first character up to the last character in the range. The second method is to create a character filter file and based on the filter create a reduced character font table. The second method is effective in implementing multi-language applications using only a fraction of the memory required for a full font table implementation. This is especially true for Asian fonts such as Chinese, Japanese and Korean fonts.

Importing images also requires a step to convert images to BMP or JPEG format if the original format is of a different type. Multiple image editors that convert other formats to BMP or JPEG format are readily available from software vendors. Microsoft’s Paint application is one such image editor. For advanced image editing using an application called GIMP ( [image] www.gimp.org) is recommended because it supports capability to do generate optimized color palette for image which can reduce image size.

Importing binary files requires the file to have a .bin extension. Any file to convert in a raw binary format can be renamed to have the .bin extension and loaded into the converter.

Creating a palette can be done in a number of ways, GIMP palette or bitmaps. You can have the converter generate a palette based on the bitmaps that are currently loaded into the resource table. The converter will re-format the bitmaps to use the generated palette table.

Graphics Resource Converter
Microchip Graphics Resource Converter 3.00 - November, 2010
Copyright (c) 2010. Microchip Technology, Inc. All rights reserved


SW License Agreement

Contents | Index | Home
Previous | Next
SW License Agreement

MICROCHIP IS WILLING TO LICENSE THE ACCOMPANYING SOFTWARE AND DOCUMENTATION TO YOU ONLY ON THE CONDITION THAT YOU ACCEPT ALL OF THE FOLLOWING TERMS. TO ACCEPT THE TERMS OF THIS LICENSE, CLICK "I ACCEPT" AND PROCEED WITH THE DOWNLOAD OR INSTALL. IF YOU DO NOT ACCEPT THESE LICENSE TERMS, CLICK "I DO NOT ACCEPT," AND DO NOT DOWNLOAD OR INSTALL THIS SOFTWARE. BY DOWNLOADING AND INSTALLING THE SOFTWARE, LICENSEE AGREES TO BE BOUND BY THE TERMS OF THIS AGREEMENT.

NON-EXCLUSIVE SOFTWARE LICENSE AGREEMENT FOR ACCOMPANYING MICROCHIP SOFTWARE AND DOCUMENTATION

This Nonexclusive Software License Agreement ("Agreement") is a contract between you, your heirs, successors and assigns ("Licensee") and Microchip Technology Incorporated, a Delaware corporation, with a principal place of business at 2355 W. Chandler Blvd., Chandler, AZ 85224-6199, and its subsidiary, Microchip Technology (Barbados) II Incorporated (collectively, "Microchip") for the accompanying Microchip software including, but not limited to, Graphics Library Software, IrDA Stack Software, MCHPFSUSB Stack Software, Memory Disk Drive File System Software, mTouch(TM) Capacitive Library Software, Smart Card Library Software, TCP/IP Stack Software, MiWi(TM) DE Software, and/or any PC programs and any updates thereto (collectively, the "Software"), and accompanying documentation, including images and any other graphic resources provided by Microchip ("Documentation").

The Software and Documentation are licensed under this Agreement and not sold. U.S. copyright laws, international copyright treaties, and other intellectual property laws and treaties protect the Software and Documentation. Microchip reserves all rights not expressly granted to Licensee in this Agreement.

(1) Definitions. As used in this Agreement, the following capitalized terms will have the meanings defined below:

a. "Microchip Products" means Microchip microcontrollers and Microchip digital signal controllers.

b. "Licensee Products" means Licensee products that use or incorporate Microchip Products.

c. "Object Code" means the Software computer programming code that is in binary form (including related documentation, if any), and error corrections, improvements, modifications, and updates.

d. "Source Code" means the Software computer programming code that may be printed out or displayed in human readable form (including related programmer comments and documentation, if any), and error corrections, improvements, modifications, and updates.

e. "Third Party" means Licensee’s agents, representatives, consultants, clients, customers, or contract manufacturers.

f. "Third Party Products" means Third Party products that use or incorporate Microchip Products.

(2) Software License Grant. Microchip grants strictly to Licensee a non-exclusive, non-transferable, worldwide license to:

a. use the Software in connection with Licensee Products and/or Third Party Products;

b. if Source Code is provided, modify the Software, provided that no Open Source Components (defined in Section 5 below) are incorporated into such Software in such a way that would affect Microchip’s right to distribute the Software with the limitations set forth herein and provided that Licensee clearly notifies Third Parties regarding such modifications;

c. distribute the Software to Third Parties for use in Third Party Products, so long as such Third Party agrees to be bound by this Agreement (in writing or by "click to accept") and this Agreement accompanies such distribution;

d. sublicense to a Third Party to use the Software, so long as such Third Party agrees to be bound by this Agreement (in writing or by "click to accept");

e. with respect to the TCP/IP Stack Software, Licensee may port the ENC28J60.c, ENC28J60.h, ENCX24J600.c, and ENCX24J600.h driver source files to a non-Microchip Product used in conjunction with a Microchip ethernet controller;

f. with respect to the MiWi (TM) DE Software, Licensee may only exercise its rights when the Software is embedded on a Microchip Product and used with a Microchip radio frequency transceiver or UBEC UZ2400 radio frequency transceiver which are integrated into Licensee Products or Third Party Products.

For purposes of clarity, Licensee may NOT embed the Software on a non-Microchip Product, except as described in this Section.

(3) Documentation License Grant. Microchip grants strictly to Licensee a non-exclusive, non-transferable, worldwide license to use the Documentation in support of Licensee's authorized use of the Software

(4) Third Party Requirements. Licensee acknowledges that it is Licensee’s responsibility to comply with any third party license terms or requirements applicable to the use of such third party software, specifications, systems, or tools. Microchip is not responsible and will not be held responsible in any manner for Licensee’s failure to comply with such applicable terms or requirements.

(5) Open Source Components. Notwithstanding the license grant in Section 1 above, Licensee further acknowledges that certain components of the Software may be covered by so-called "open source" software licenses ("Open Source Components"). Open Source Components means any software licenses approved as open source licenses by the Open Source Initiative or any substantially similar licenses, including without limitation any license that, as a condition of distribution of the software licensed under such license, requires that the distributor make the software available in source code format. To the extent required by the licenses covering Open Source Components, the terms of such license will apply in lieu of the terms of this Agreement, and Microchip hereby represents and warrants that the licenses granted to such Open Source Components will be no less broad than the license granted in Section 1. To the extent the terms of the licenses applicable to Open Source Components prohibit any of the restrictions in this Agreement with respect to such Open Source Components, such restrictions will not apply to such Open Source Component.

(6) Licensee Obligations.

a. Licensee will ensure Third Party compliance with the terms of this Agreement, and will be liable for any breach of this Agreement committed by such Third Party.

b. Licensee will not: (i) engage in unauthorized use, modification, disclosure or distribution of Software or Documentation, or its derivatives; (ii) use all or any portion of the Software, Documentation, or its derivatives except in conjunction with Microchip Products or Third Party Products; or (iii) reverse engineer (by disassembly, decompilation or otherwise) Software or any portion thereof.

c. Licensee may not remove or alter any Microchip copyright or other proprietary rights notice posted in any portion of the Software or Documentation.

d. Licensee will defend, indemnify and hold Microchip and its subsidiaries harmless from and against any and all claims, costs, damages, expenses (including reasonable attorney's fees), liabilities, and losses, including without limitation product liability claims, directly or indirectly arising from or related to: (i) the use, modification, disclosure or distribution of the Software, Documentation, or any intellectual property rights related thereto; (ii) the use, sale and distribution of Licensee Products or Third Party Products; and (iii) breach of this Agreement. THIS SECTION 3(d) STATES THE SOLE AND EXCLUSIVE LIABILITY OF THE PARTIES FOR INTELLECTUAL PROPERTY INFRINGEMENT.

(7) Confidentiality. Licensee agrees that the Software (including but not limited to the Source Code, Object Code and library files) and its derivatives, Documentation and underlying inventions, algorithms, know-how and ideas relating to the Software and the Documentation are proprietary information belonging to Microchip and its licensors ("Proprietary Information"). Except as expressly and unambiguously allowed herein, Licensee will hold in confidence and not use or disclose any Proprietary Information and will similarly bind its employees and Third Party(ies) in writing. Proprietary Information will not include information that: (i) is in or enters the public domain without breach of this Agreement and through no fault of the receiving party; (ii) the receiving party was legally in possession of prior to receiving it; (iii) the receiving party can demonstrate was developed by the receiving party independently and without use of or reference to the disclosing party's Proprietary Information; or (iv) the receiving party receives from a third party without restriction on disclosure. If Licensee is required to disclose Proprietary Information by law, court order, or government agency, License will give Microchip prompt notice of such requirement in order to allow Microchip to object or limit such disclosure. Licensee agrees that the provisions of this Agreement regarding unauthorized use and nondisclosure of the Software, Documentation and related Proprietary Rights are necessary to protect the legitimate business interests of Microchip and its licensors and that monetary damage alone cannot adequately compensate Microchip or its licensors if such provisions are violated. Licensee, therefore, agrees that if Microchip alleges that Licensee or Third Party has breached or violated such provision then Microchip will have the right to petition for injunctive relief, without the requirement for the posting of a bond, in addition to all other remedies at law or in equity.

(8) Ownership of Proprietary Rights. Microchip and its licensors retain all right, title and interest in and to the Software and Documentation ("Proprietary Rights") including, but not limited to all patent, copyright, trade secret and other intellectual property rights in the Software, Documentation, and underlying technology and all copies and derivative works thereof (by whomever produced). Further, copies and derivative works will be considered works made for hire with ownership vesting in Microchip on creation. To the extent such modifications and derivatives do not qualify as a "work for hire," Licensee hereby irrevocably transfers, assigns and conveys the exclusive copyright thereof to Microchip, free and clear of any and all liens, claims or other encumbrances, to the fullest extent permitted by law. Licensee and Third Party use of such modifications and derivatives is limited to the license rights described in Sections this Agreement.

(9) Termination of Agreement. Without prejudice to any other rights, this Agreement terminates immediately, without notice by Microchip, upon a failure by Licensee or Third Party to comply with any provision of this Agreement. Upon termination, Licensee and Third Party will immediately stop using the Software, Documentation, and derivatives thereof, and immediately destroy all such copies.

(10) Warranty Disclaimers. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. MICROCHIP AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR THE ACCURACY, RELIABILITY OR APPLICATION OF THE SOFTWARE OR DOCUMENTATION. MICROCHIP AND ITS LICENSORS DO NOT WARRANT THAT THE SOFTWARE WILL MEET REQUIREMENTS OF LICENSEE OR THIRD PARTY, BE UNINTERRUPTED OR ERROR-FREE. MICROCHIP AND ITS LICENSORS HAVE NO OBLIGATION TO CORRECT ANY DEFECTS IN THE SOFTWARE. LICENSEE AND THIRD PARTY ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE AND DOCUMENTATION PROVIDED UNDER THIS AGREEMENT.

(11) Limited Liability. IN NO EVENT WILL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL OR EQUITABLE THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. The aggregate and cumulative liability of Microchip and its licensors for damages hereunder will in no event exceed $1000 or the amount Licensee paid Microchip for the Software and Documentation, whichever is greater. Licensee acknowledges that the foregoing limitations are reasonable and an essential part of this Agreement.

LICENSEE ACKNOWLEDGES AND AGREES THAT IT IS SOLELY RESPONSIBLE FOR THE LICENSEE PRODUCTS AND THIRD PARTY PRODUCTS, INCLUDING DETERMINING WHETHER SUCH PRODUCTS INFRINGE A PATENT, COPYRIGHT OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY. LICENSEE AGREES THAT MICROCHIP HAS NO OBLIGATION TO INDEMNIFY OR DEFEND LICENSEE IN THE EVENT THAT A THIRD PARTY MAKES A CLAIM REGARDING LICENSEE PRODUCTS OR THIRD PARTY PRODUCTS.

(12) General. THIS AGREEMENT WILL BE GOVERNED BY AND CONSTRUED UNDER THE LAWS OF THE STATE OF ARIZONA AND THE UNITED STATES WITHOUT REGARD TO CONFLICTS OF LAWS PROVISIONS. Licensee agrees that any disputes arising out of or related to this Agreement, Software or Documentation will be brought in the courts of the State of Arizona. The parties agree to waive their rights to a jury trial in actions relating to this Agreement. If either the Microchip or Licensee employs attorneys to enforce any rights arising out of or relating to this Agreement, the prevailing party will be entitled to recover its reasonable attorneys' fees, costs and other expenses. This Agreement will constitute the entire agreement between the parties with respect to the subject matter hereof. It will not be modified except by a written agreement signed by an authorized representative of the Microchip. Microchip’s authorized representatives will have the right to reasonably inspect Licensee's premises and to audit Licensee's records and inventory of Licensee Products in order to ensure Licensee's adherence to the terms of this Agreement. If any provision of this Agreement will be held by a court of competent jurisdiction to be illegal, invalid or unenforceable, that provision will be limited or eliminated to the minimum extent necessary so that this Agreement will otherwise remain in full force and effect and enforceable. No waiver of any breach of any provision of this Agreement will constitute a waiver of any prior, concurrent or subsequent breach of the same or any other provisions hereof, and no waiver will be effective unless made in writing and signed by an authorized representative of the waiving party. Licensee agrees to comply with all export laws and restrictions and regulations of the Department of Commerce or other United States or foreign agency or authority. The indemnities, obligations of confidentiality, and limitations on liability described herein, and any right of action for breach of this Agreement prior to termination, will survive any termination of this Agreement. Neither this Agreement nor any rights, licenses or obligations hereunder, may be assigned by Licensee without the prior written approval of Microchip except pursuant to a merger, sale of all assets of Licensee or other corporate reorganization, provided that assignee agrees in writing to be bound by the Agreement. Any prohibited assignment will be null and void. Use, duplication or disclosure by the United States Government is subject to restrictions set forth in subparagraphs (a) through (d) of the Commercial Computer-Restricted Rights clause of FAR 52.227-19 when applicable, or in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, and in similar clauses in the NASA FAR Supplement. Contractor/manufacturer is Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85224-6199.

If Licensee has any questions about this Agreement, please write to Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85224-6199 USA. ATTN: Marketing.

Copyright (c) 2011 Microchip Technology Inc. All rights reserved.

License Rev. No. 03-060111

SW License Agreement


Release Notes

Release Notes
Microchip Graphics Resource Converter

This application is based on the JAVA programming language. To effectively run this program, the computer must have [image] JRE 6 installed.

Version 3.03.01

Bug Fixes

  1. Drop-down combo box to choose the starting and ending character range in the font option dialog
    1. The character display has been fixed to show the correct character representation.
  2. When loading projects that reference files that do not exist.
    1. The user will be given the option to delete the resource of the non-existent file and keep all valid resources or remove all resources.
    2. The project file will not be modified until the user selects to save the project.

Version 3.03

New Features

  1. Multiple bits per pixel (bpp) output support. Based on the graphics controller, the GRC can output the conversion in 16 or 24 bpp. This feature does not limit input sources. For example, if the output conversion is set to 16bpp and a 24bpp btimap image is being converted, the image will be converted to a 16bpp image.
  2. Conversion of bitmap images that are in 16bpp format. The GRC will convert bitmap images saved in x555 or 565 color format. The GRC will also up convert those images to 24bpp if converted as 24bpp Graphics Module.
  3. The reference header file generated after converting resources will now contain a #define of the images width and height in pixels.
  4. Generation of a palette from multiple bitmap images.
    1. Added reading of comments from the GIMP file.
    2. Allow the user to load a GIMP file to set comments
    3. Created a header file with the symbol names of the palette colors
  5. Added Run Length Encoding (RLE) support for bitmaps that are 4bpp and 8bpp.
  6. Added support for Font Filter files that are saved in a UTF-8 format.
  7. The converter is able to converter raw binary data into a C array, hex file or binary file.
    1. Drag and drop support is available.
  8. Added drag and drop support for project files.
  9. Added command line support.
    1. Allows a user to run the converter tool from the command line interface without invoking the GUI.
  10. Changed the function buttons, like project load and save, to tool bar buttons.
  11. Use internal Inflate JAVA library
    1. Support multiple operating systems.

Bug Fixes

  1. Switching to PSV data space from program space at the end of a resource conversion when converting using the C30 compiler type.
  2. Handling of projects that have resources on two different drives (Windows only).
  3. UTF-16 little and big endian font filter fix.
  4. Handle blank lines in the font filter
  5. When generating a hex file using images in IPU, use the IPU generated size to determine the address location.
  6. Proper handling of loading and saving projects that contain FNT font files.
  7. Scrolling through the list box in the font dialog using the arrow keys, the wrong information would be displayed (size for the name of the font).
  8. Made the adding the correct file extension more robust when naming a conversion file
  9. Corrected the font filter error where the encoding header with being placed in the symbol name..

Version 3.00

  1. When importing images (BMP and JPEG), the user can select multiple files in the file dialog box to import.
  2. Drag-and-drop is supported to import images.
  3. The application supports selective resources to convert.
  4. New installed font chooser.
  5. Projects are saved in xml format.
  6. Projects will save installed font information.
  7. Source file output (C Array) for fonts, has the font character glyph in the comments.
  8. Source file output has a table of contents for easier object searching.
  9. Font filtering will check to make sure that the selected character range is supported by the selected font.
  10. Multiple operating system platform support
  11. New GUI interface.
  12. Support for IPU unit.
    1. This is only supported by PIC microcontroller with graphics modules.
    2. Only supported on Microsoft Windows operating systems.
  13. The font underline style has not been added to this version.
    1. The work around for this is to create the font without any underline style and after drawing the characters at runtime, use the primitive line function to add the underline.
Release Notes


User Interface

User Interface

The main window of the Graphics Resource Converter utility has a list box to display items chosen for conversion and several control buttons.

Menu Bar

The Graphics Resource Converter menu bar can be used to add resources like images and font, as well as load and save projects, and there is access to help and support.

Tool Bar Buttons

The tool bar buttons are used to add or remove resources, load and save projects, change convert settings and convert resources.

Resource Table

The resource table displays the current resources of a project.

Current Project Name

This label displays the current project that has been loaded. If there is no project currently loaded, the area will be blank.

Convert Settings

This set of labels displays the convert settings for the project.

Current Converting Resource

When the Graphic Resource Converter is converting resources, the current resource being converted is displayed.

Converting Progress

The overall progress of the when converting resources. This is based on the number of files and the relative size of the file to the overall project being converted.

User Interface


Menu Bar

Contents | Index | Home
Previous | Up | Next
Menu Bar
Menu Bar

The Graphics Resource Converter menu bar can be used to add resources like images and font, as well as load and save projects, and there is access to help and support.

File

Add Images - Loads an image (BMP, JPG or JPEG) as a resource.

Add Palette - Loads a palette from a bitmap or GIMP file. This feature is only available for PIC microcontroller that have an internal graphics module.

Add Fonts - Loads a font from a true type font (.ttf) or Windows font file format (.fnt).

Add Installed Fonts - Loads a font from the operating system's list of installed fonts.

Exit - Quits the application

Project

Load - Loads a graphics resource project.

Save - Saves the current project.

Save As - Save the current project under a new project name.

Convert.... - Converts the project

Settings - Opens the settings dialog box.

Help

Microchip Graphics Web Site - Opens a web browser to the Microchip Graphics design center page.

Microchip Support - Opens a web browser to the Microchip Support log in page

Help Topics - Opens the Help documentation for the Graphics Resource Converter.

About.. - Opens the About window.

User Interface > Menu Bar


Tool Bar Buttons

Contents | Index | Home
Previous | Up | Next
Tool Bar Buttons

Project

Load - Loads a graphics resource project.

Save - Saves the current project.

Resource

Images - Loads an image (BMP, JPG or JPEG) as a resource.

Palette - Loads a palette from a bitmap or GIMP file. This feature is only available for PIC microcontroller that have an internal graphics module.

Font File - Loads a font from a ttf or fnt font file format.

Installed Fonts - Loads a font from the operating system's list of installed fonts.

Binary - Loads a raw binary file (.bin) as a resource.

Table Modification

Remove Row - Removes selected row(s) from the resource table. This operation can not be reversed.

Convert and Settings

Convert - Converts the selected resources.

Settings - Sets the compiler, C30 or C32, graphics module, converted resource output and the color depth output.

User Interface > Tool Bar Buttons


Resource Table

Contents | Index | Home
Previous | Up | Next
Resource Table

Compression

Indicates if any compression is used to reduce the size of a resource. Not all of the compression options are available for every compiler or module setting. For example, the IPU option is only available for the C30 with a graphics module.

Convert

Converting resources, if this box is not checked, the resource will not be converted.

Label

The label that will be given to the resource that the Microchip Graphics Library will reference. For example, the label, Animation_4bpp_72x72, will be used by the Microchip Graphics Library.

Type

The type of resource to be converted. Valid resource types are Bitmap, JPEG, Palette, Font, and Font File.

Size

The size, in bytes, of the converted resource. This size is representative of compressed or uncompressed resource.

Description

A description of the resource. For images, the description is the size, in pixels. For palettes, the description is the number of colors. For fonts, the description is the font character range and the height of the font in pixels. The user is responsible for not choosing C syntax names, i.e. char, short, int, or reserved keywords, i.e. for if, else.

User Interface > Resource Table


Status

Contents | Index | Home
Previous | Up | Next
Status

Current Project

Shows the current project of the Graphics Resource Converter.

Current Settings

Shows the current settings of the Graphics Resource Converter, the compiler, C30 or C32, graphics module, what format the converted resources will be saved as and the display bits per pixel.

Current Resource Being Converted

An indicator showing the current resource that is being converted.

Convert Progress

The converting resource progress measured in bytes converted to total bytes to convert.

User Interface > Status


Adding Images to the Conversion List

Adding Images to the Conversion List

To add an image (bitmap or JPEG format) for conversion the following steps should be done:

  1. Press Add Images button or File menu item.

  2. A file dialog box will appear. The user can select a single or multiple files to import to the Graphics Resource Convert. When done, select the Open button.

  3. If selected file will be imported successfully the information about it (label, type, size and description) will be added in the list box of the main window. Label is generated from the file name, type defines that imported object is using a bitmap or a JPEG format, size of data is shown in bytes, and description contains basic information. Generated label must be used for the reference to this image in the application.

  4. Graphics Resource Converter also supports Drag-and-Drop for adding images. Simply select the images files and drag them to the resource table.

  4. To change the label double click on it and modify the label. The first label letter cannot be a number.

Using the Utility > Adding Images to the Conversion List


Adding Installed Fonts to the Conversion List

Adding Installed Fonts to the Conversion List

Importing Fonts using a Range of Characters

This option is normally done in languages with character sets of 255 characters or less. A range of characters is defined from one character index to the another character index. An example would be the ASCII character set where the English characters are defined from character index 32 or 0x20 hex (space character) to character index 126 or 0x7E hex(~ character). The font table generated for the range will contain all the characters from 0x20 to 0x7E inclusive. User's who want to use some other fonts with UNICODE character ranges can still be handled by this utility. The font table generated will still contain the characters with the defined range. Character index that has no defined characters glyph will be either a blank space or assigned to a default character. However, this approach is wasteful in terms of memory and it is recommended to use a font filter.

Importing Fonts using Character ID Filter

Another way to overcome the problem of memory requirements for fonts with thousands of character indexes is filtering the font table and recreating a reduced character set table which contains only the pre-defined characters. This approach will need a filter text file (described in Font Filter File Format section). The generated font table will contain all the character glyphs of the characters defined in the filter file. Except for the first character (character with the lowest character index) the character indexes of all the glyphs are changed. The utility will also generate a C source reference file to be used in the application to easily refer to the new font table. The figure below shows the general components in generating a reduced font table with its outputs.

To add an installed font for conversion the following steps should be done:

  1. Press Add Installed Fonts button or the File menu item. "Font Chooser" dialog will appear.

  2. In the dialog select the installed fonts that will be used along with the "Font Style", "Font Size", "Unicode Range", "Starting Character", "Ending Character" and "Font Filter" button. An example of the selected font can be previewed with the height of the selected font in pixels.

  3. A font filter can be selected by pressing the "Font Filter" button. When selecting the "Font Filter" button, a file dialog will appear. This gives the user the opportunity to assign a font character filter to the selected font. This filter will be used to extract character ID's that will comprise the font table.

  4. If filtering is not used, it is assumed by the utility that the user wants to use a range of characters instead. The user can choose a range of the characters that will be used in the font table. Starting Character sets the character index of the first character in the table. Ending Character sets the character index of the last character in the table.

  5. After selecting the font and all of it's attributes, press OK and it will appear in the resource table.

Using the Utility > Adding Installed Fonts to the Conversion List


Adding Fonts from Files to the Conversion List

Adding Fonts from Files to the Conversion List

Importing Fonts from Files

Aside from the installed fonts, the user can also import a font table from a raster font file (*.fnt) or from a true type font file (*.ttf). Raster fonts can only import fonts with character sets ranging from 0-255. True type fonts on the other hand can be imported with the same options as installed fonts. They can be imported using a range of character ID or using a font filter file.

To add fonts using font files as inputs the following steps should be done:

  1. Press Add Fonts button or File menu item. "Add font" dialog will appear.

  2. In the dialog select the file type extension to select importing raster font (*.fnt) or true type font (*.ttf). Browse and select the file and press Open.
    • Go to step 6 to generate raster fonts.
    • Go to step 3 to generate true type fonts.

  3. "Font Style Chooser" dialog will open. This dialog will show parameters for the selected true type font that can be set. Most importantly it shows the character sets or UNICODE ranges that the font supports.

  3. A font filter can be selected by pressing the "Font Filter" button. When selecting the "Font Filter" button, a file dialog will appear. This gives the user the opportunity to assign a font character filter to the selected font. This filter will be used to extract character ID's that will comprise the font table.

  5. Press OK to generate the font table.
  6. When raster fonts are selected instead of true type fonts, instead of the "Font Style Chooser" dialog box "Font Filter" dialog box will appear.

  7. Set the desired character range and press OK to generate the font table.
Using the Utility > Adding Fonts from Files to the Conversion List


Adding Palettes to the Conversion List

Adding Palettes to the Conversion List

Importing Palettes

The tool can extract the color table of a bitmap file (bitmaps with 24-bit colors do not have color tables, the tool will not process these files) or load a GIMP palette file (*.gpl). To add a palette to the resource converter, the target must have an internal graphics module.

To load the color table of a bitmap file the following steps should be done:

  1. Press Add Palette button or File menu item. "Open file" dialog will appear.

  2. A file dialog will appear and by default, filters the Bitmap File (*.bmp filter) or the GIMP Palette file (*.gpl filter).Browse for the image file to be added and press Open button.

  3. If selected file will be imported successfully the information about it (label, type, size and description) will be added in the list box of the main window. Label is generated from the file name, type defines that imported object is a palette, size of data is shown in bytes, and description contains the number of color entries in the palette. Generated label must be used for the reference to this image in the application.

  4. To change the label double click on it. Modify the label and press OK when done. The first label letter cannot be a number.

  5. By double clicking on the palette entry a dialog box will appear to allow the user to edit the color table.

  6. Double click on the color entry in the table to edit it. A color chooser will appear. Select the new color and select OK.

  7. After done making edits, select OK. If you want to change the palette, select YES.

  8. An input window will appear to create a new label.

Using the Utility > Adding Palettes to the Conversion List


Removing Item from the Conversion List

Removing Item from the Conversion List

To remove some item from conversion list select the item or items and press Remove button. This action can not be undone.

Using the Utility > Removing Item from the Conversion List


Saving and Loading Projects

Saving and Loading Projects

The utility allows users to save the loaded images, palettes and fonts into a project and to load a previously saved project.

Saving a Project

To save a project the following steps should be done:

  1. Press Save button or Project Menu Item.

  2. A Save As dialog will appear and, by default, filters the project file (*.xml filter).Type the new project file name or browse for the project file that will be overwritten and and press Save button.

  3. The saved project will create a *.xml file and the project name will be placed in the status bar.

Loading a Project

To load a project the following steps should be done:

  1. Press Load button or the Project menu item.

  2. A Open dialog will appear and, by default, filters the project file (*.grp filter or *.xml filter).Type the project file name or browse for the project file that will be loaded and and press Open button.

  3. After selecting the project, the resource table will be populated and the status will be updated.

Using the Utility > Saving and Loading Projects


Settings

Settings

The Graphics Resource Converter can be configured for difference types of converting mediums along with different device builds.

To change the Graphics Resource Converter's settings

  1. Press the Settings button.

  2. The Graphics Resource Setting dialog box will appear. The left side of the dialog has all of the configuration options, while the right side give a description of the configuration options that are currently selected.

  3. The Compiler Type panel contains the compiler build type
    1. C32 - Select this to convert for a format which MPLAB C32 is able to interpret. This setting is used for PIC32MX devices.
    2. C30 - Select this to convert for a format which MPLAB C30 is able to interpret. This setting is used for PIC24F, PIC24H and dsPIC devices.
    3. Checking the Graphics Module will indicate that the device also has an internal graphics module. Please refer to the device's datasheet or Family Reference Manual to determine if it has an internal graphics module.

  4. The Format Type panel contains the medium for the converted resources
    1. Internal Flash - The converted resources will be stored as C array structures. Proper device resources are needed to store these C array structures.
    2. External Flash - The converted resources will be stored as a Intel HEX file. This HEX file can be uploaded to an external memory source. The device will access this memory source to retrieve the resource data.
    3. Binary - The converted resources will be converted into a binary file.
    4. EDS EPMP - On devices with EDS memory space, the converted resources can be placed into this EDS space.

  5. The Graphics Module Bits per Pixel option is for selecting the output of the converted image resources. Some graphics devices support different color depth. This option will allow the suer to select the color depth of 16bpp or 24bpp. It is import to note that this setting does not determine the color depth of the input resources. The application will down covert if needed. For example, a bitmap image that is 24bpp will be converted as a 16bpp if the Graphics Module Bits per Pixel setting is 16bpp.

  6. After selecting the desired configuration settings, select OK and the status bar will populated with the current configuration settings. These configuration settings are saved with the project.

Using the Utility > Settings


Converting into C file

Converting into C file

There is a limitation on the memory used when generating font images in C files (to be stored in internal flash for PIC24 devices). The font images are placed in the const section. The const section has a maximum size of 32 Kbytes. Therefore, the maximum size that the font image can have is 32 Kbyte assuming that no other data will reside in the const section. When generating more than one font images, the total size of all the font images must fit into the 32Kbyte space. If one of the font image requirement exceeds 32 Kbytes, that font image must be stored in external memory. When stored in external memory, the limitation will be the external memory size. The reason for storing fonts in the const section in internal flash is performance. It is faster to retrieve and display characters in the screen when placed in the const section.

For PIC32, there is no limitation. As long as the internal flash has space you can pack in more font images.

Conversion of C file containing arrays to be located in internal flash memory is similar to the conversion of the Hex file.

This conversion type should be used to store fonts and bitmaps into internal flash memory. The following steps must be performed:

  1. Press Convert button.

  2. “Converted Resources” dialog will appear.

  3. Press Convert button.

  4. When the resources have been converted, a dialog will appear indicating such.

Using the Utility > Converting > Converting into C file


Conversion into Intel Hex File

Conversion into Intel Hex File

This output format should be selected to store bitmaps and fonts in external memory. Address of each object will be aligned by 4 bytes border. In addition to Intel hex file the utility will generate C file containing structures FONT_EXTERNAL and IMAGE_EXTERNAL. These structures must be used in application to access converted pictures and fonts in external memory. Name of the reference C file will be the same as name of the hex file with “.c” appended. This file will be compiled with the application to enable an easy reference to the strings that will be used in the application. Please refer to Font Reference File Output description.

To create Intel Hex and reference C files following steps must be performed:

  1. Press Convert button.

  2. “Convert Resources” dialog will appear.

  3. Press Convert button.

  4. “Data offset and Memory ID” dialog will appear.

  7. Enter start address if the converting data must have special location in the external memory.
  8. Enter memory ID. Memory ID is a unique number assigned by application for the memory chip where data will be stored. This number allows distinguishing memory chip if the application has several of them.
  9. Press OK. Conversion Complete message will appear when files are created successfully.

Using the Utility > Converting > Conversion into Intel Hex File


Converting into Binary file

Converting into Binary file

This output format allows creating binary files for objects in the conversion list. Each bitmap or font image will be stored in a separate file. The following steps should be done:

  1. Press Convert button.

  2. “Converted Resources” dialog will appear.

  3. Press Convert button.

  4. When the resources have been converted, a dialog will appear indicating such.

Using the Utility > Converting > Converting into Binary file


Conversion into Intel HEX in EDS Space

Conversion into Intel HEX in EDS Space

This output format should be selected to store bitmaps and fonts in external memory. Address of each object will be aligned by 4 bytes border. In addition to Intel hex file the utility will generate C file containing structures FONT_EXTERNAL and GFX_IMAGE_HEADER. These structures must be used in application to access converted pictures and fonts in external memory. Name of the reference C file will be the same as name of the hex file with “.c” appended. This file will be compiled with the application to enable an easy reference to the strings that will be used in the application. Please refer to Font Reference File Output description. The device that the resources are being converted to must have EDS space access through EPMP. Please check the device datasheet for this information.

To create Intel Hex and reference C files following steps must be performed:

  1. Press Convert button.

  2. “Convert Resources” dialog will appear.

  3. Press Convert button.

  4. “Data offset and Memory ID” dialog will appear.

  7. Enter start address if the converting data must have special location in the external memory.
  8. Enter EPMP Chip Select. The EPMP Chip Select is the value of the chip select being used. Zero is not a valid number for the chip select.
  9. Press OK. Conversion Complete message will appear when files are created successfully.

Using the Utility > Converting > Conversion into Intel HEX in EDS Space


Generating a Palette from Bitmap Images

Generating a Palette from Bitmap Images

The converter can generate a palette based on bitmap images that are loaded into the resource table. If there are any JPEG images, the palette obtain will not be available. The palette that is generated will be up to 256 colors and the bitmap images will be reformatted to use the generated palette.

Generating a Palette

To generate a palette follow these steps:

  1. Add all of the bitmap images to the converter for the project.

  2. Under the settings dialog box, make sure that the graphics module option is selected. Palettes will not be generated for projects that do not have a graphics module.

  3. When prompted, choose YES to allow the converter to auto generate the palette.

  4. Enter the palette label that you wish to use.

  5. You will see that a palette has been generated from the individual bitmap images.

  6. By double clocking on the palette resource in the resource table, you will bring up the color chart.

  7. You can manually add in comments that, when converted will become part of a palette color defines header file.
    1. The application can include this file to reference the color palette index via a symbol

  8. Selecting the Color Palette Symbol File button will load a GIMP palette and use the comments in the file.
    1. The generated color palette will match the colors in the GIMP palette file to place the comments

  9. Convert the project into the medium of choice.
Using the Utility > Generating a Palette from Bitmap Images


Font Filter File Format

Font Filter File Format

The font filter file is a text file created in a text editor capable of handling Unicode fonts and saving text files in 16-bit Unicode format. The format of the filter file is shown below:

Copy Code
ButtonStr: ボタン // Buttons
CheckBoxStr: チェックボックス // Checkbox
RadioButtonStr: ラジオボタン //Radio buttons
GroupBoxStr: グループボックス //GroupBox
StaticTextStr: 静止テキスト //StaticText
SliderStr: スライダー //Slider
ProgressBarStr: プログレスバー //Progress bar
ListBoxStr: リストボックス //List box
EditBoxStr: 編集ボックス //Edit box
MeterStr: メーター //Meter
DialStr: ダイヤル //Dial
PictureStr: 画像 //Picture
StaticTextLstStr: マイクロチップの
                    グラフィック
                    ライブラリ
                    静止テキストおよび
                    グループボックス
                    のテスト。      //Microchip Graphics Library Static Text and Group Box Test.
include:    1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ    //
include:    abcdefghijklmnopqrstuvwxyz              //
include:    "!#$%&'()*+`-.,/:;<=>?@[\]^_"      //dummy string to include the standard ASCII character set numbers and alphabet.

Each line is divided into three sections:

String Label Section | String Section | Comment Section
ButtonStr: | ボタン | // Buttons
  1. The string label section - This is the same string label that will be used in the C reference file that will define the character array created for the string it describes. "include" is a special string label that signifies the characters in the string section will be included in the font table but the generated C reference file will not include the string. Note that the character IDs may change so to maintain the character ID of the ASCII characters the whole range of characters from 32 to 127 must be explictly included (as shown in the example above).
  2. The string section - The source of the character ID filter to generate the reduced font table.
  3. the comment section - This is an optional comment section that users may want to add to the string. The comments are optional but the "//" comment indicator is required.

The string label section should be characters using the ASCII codes with identifier names complying with standard C format. This is a requirement since the compiler will not be able to generate code when variable names are not using the standard C formats. The string section will be encoded into an array of 2 byte character ID that the utility will generate. Each line should be terminated by a newline character.

Spaces are counted as characters in the string. Except for the new line character ("/n" or 0x000A), tabs and other control characters are ignored. An example is shown in the "StaticTextLstStr" shown above.

An example of an editor that can be used is the Word Pad. Another good editor is the BabelPad Version 1.9.3. This is an editor tool available at [image] http://www.babelstone.co.uk/Software/BabelPad.html.

Input and Output File Formats > Font Filter File Format


Font Reference File Output

Font Reference File Output

The font reference file is created to help in the usage of the filtered font table and referencing strings in the application. An example of the output of the font reference file is shown below:

Copy Code
XCHAR ButtonStr[] = {0x00B2, 0x00A6, 0x00BD, 0x0000}; // Buttons
XCHAR CheckBoxStr[] = {0x00A8, 0x009A, 0x00A9, 0x009E, 0x00B2, 0x00A9, 0x009E, 0x00A5, 0x0000}; // Checkbox
XCHAR RadioButtonStr[] = {0x00B8, 0x00A4, 0x009B, 0x00B2, 0x00A6, 0x00BD, 0x0000}; //Radio buttons
XCHAR GroupBoxStr[] = {0x009F, 0x00BA, 0x00BE, 0x00B0, 0x00B2, 0x00A9, 0x009E, 0x00A5, 0x0000}; //GroupBox
XCHAR StaticTextStr[] = {0x00EC, 0x00DB, 0x00AA, 0x009D, 0x00A5, 0x00AB, 0x0000}; //StaticText
XCHAR SliderStr[] = {0x00A5, 0x00B8, 0x0099, 0x00A7, 0x00BE, 0x0000}; //Slider
XCHAR ProgressBarStr[] = {0x00B0, 0x00BC, 0x009F, 0x00BB, 0x00A5, 0x00AD, 0x00BE, 0x0000}; //Progress bar
XCHAR ListBoxStr[] = {0x00B9, 0x00A5, 0x00AB, 0x00B2, 0x00A9, 0x009E, 0x00A5, 0x0000}; //List box
XCHAR EditBoxStr[] = {0x00E3, 0x00EB, 0x00B2, 0x00A9, 0x009E, 0x00A5, 0x0000}; //Edit box
XCHAR MeterStr[] = {0x00B5, 0x00BE, 0x00A6, 0x00BE, 0x0000}; //Meter
XCHAR DialStr[] = {0x00A7, 0x0099, 0x00B6, 0x00BA, 0x0000}; //Dial
XCHAR PictureStr[] = {0x00DE, 0x00C7, 0x0000}; //Picture
XCHAR StaticTextLstStr[] = {0x00B3, 0x0099, 0x009E, 0x00BC, 0x00A8, 0x00A9, 0x00B0, 0x0090, 0x000A,
                            0x009F, 0x00B8, 0x00AE, 0x0098, 0x00A9, 0x009E, 0x000A,
                            0x00B8, 0x0099, 0x00AF, 0x00B8, 0x00B9, 0x000A,
                            0x00EC, 0x00DB, 0x00AA, 0x009D, 0x00A5, 0x00AB, 0x0087, 0x0093, 0x0092, 0x000A,
                            0x009F, 0x00BA, 0x00BE, 0x00B0, 0x00B2, 0x00A9, 0x009E, 0x00A5, 0x000A,
                            0x0090, 0x00AA, 0x00A5, 0x00AB, 0x0083, 0x0000};    //Microchip Graphics Library Static Text and Group Box Test.

The character IDs listed in the arrays are not the same as the original IDs. This is due to the fact that the utility will be generating a font table with contiguous and no unused character ID. Unused character IDs in the original font table are removed resulting in memory saving.

Input and Output File Formats > Font Reference File Output


External Memory Reference Output

External Memory Reference Output

External memory reference file output example is shown below:

Copy Code
#include "Graphics.h"

FONT_EXTERNAL Mona_1 = {0x0001,0x0000,0x00000000};
FONT_EXTERNAL Mona = {0x0001,0x0000,0x00002280};
BITMAP_EXTERNAL myLogo = {0x0001,0x0000,0x000052FC};

In this example, two Mona font of different sizes was generated.

Input and Output File Formats > External Memory Reference Output


Output Bitmap Image Format

Output Bitmap Image Format

Image Structure for Bitmap

Block | Name | Bits | Description
Header | Reserved | 8 | Reserved
 | BPP | 8 | Bits per pixel in the bitmap
 | Height | 16 | Image height in pixels
 | Width | 16 | Image width in pixels
Color Table | First color value | 16 |
 | ... | ... | ...
 | Last color value | 16 |
Raster Data | ... | ... | ...

Color Table Entry Format (16bpp)

Bits | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
Value | R | R | R | R | R | G | G | G | G | G | G | B | B | B | B | B

Color Table Entry Format (24bpp)

Bits | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24
Value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Bits | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16
Value | R | R | R | R | R | R | R | R
Bits | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8
Value | G | G | G | G | G | G | G | G
Bits | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
Value | B | B | B | B | B | B | B | B

Raster Data Encoding

Pixels are stored left-to-right, up-to-bottom. Color indices are zero based, meaning a pixel color of 0 represents the first color table entry, a pixel color of 255 (if there are that many) represents the 256th entry. For images with more than 256 colors there is NO color table.

Raster Data Encoding for 1bit/black & white images

Every byte holds 8 pixels, its highest order bit representing the leftmost pixel. There are 2 color table entries.

Raster Data Encoding for 4bit/16 color images

Every byte holds 2 pixels, the least significant 4 bits represents the leftmost pixel. There are 16 color table entries.

Raster Data Encoding for 8bit/256 color images

Every byte holds 1 pixel. There are 256 color table entries.

Raster Data encoding for hicolor images

Hicolor images will be down sized to 16bpp if the Graphics Module configuration setting is set to 16bpp. Every 2bytes / 16bit holds 1 pixel. The pixels are not color table pointers. There are no color table entries. Color coded in format in the Color Table Entry Format shown above.

IPU Compression

After the bitmap image has been converted to the Microchip Graphics Library bitmap image, the IPU compression is preformed. The IPU compression is offered on a Microchip devices that have IPU engine.

Output Image and Font Data Formats > Output Bitmap Image Format


Font Image Format

Font Image Format

Image Structure for Fonts

Block | Char | Name | Bits | Description
Font Header |  | Font ID | 8 | User-assigned ID number
 |  | Reserve | 4 | Reserved for future use (must be set to 0)
 |  | orientation | 2 | Orientation of the character glyphs (0,90,180,270 degrees)
 |  | Reserve | 2 | Reserved for future use (must be set to 0)
 |  | First Char | 16 | Character code of first character in font (e.g. 32)
 |  | Last Char | 16 | Character code of last character in font (e.g. 3006)
 |  | Height | 8 | Character height in pixels
 |  | Reserve | 8 | Reserved for future use (must be set to 0)
Character Table | 1st Char | Width | 8 | Width in pixels
 |  | Offset LSB | 8 | Offset from font table start (8 LSBs)
 |  | Offset MSB | 16 | Offset from font table start (16 MSBs)
 | 2nd Char | Width | 8 | Width in pixels
 |  | Offset LSB | 8 | Offset from font table start (8 LSBs)
 |  | Offset MSB | 16 | Offset from font table start (16 MSBs)
 | ... | ... | ... | ...
 | ... | ... | ... | ...
 | ... | ... | ... | ...
 | Last Char | Width | 8 | Width in pixels
 |  | Offset LSB | 8 | Offset from font table start (8 LSBs)
 |  | Offset MSB | 16 | Offset from font table start (16 MSBs)
Font Bitmap | 1st Char |  | Char width dependent | Bitmap data of character
 | 2nd Char |  | Char width dependent | Bitmap data of character
 | ... | ... | ... | ...
 | Last Char |  | Char width dependent | Bitmap data of character

Font Header

All characters have the same height. FirstChar and LastChar define the first and last characters in the font image.

Character Table

This table is an array of entries each consisting of two 2-byte WORDs. The first byte of each entry is the character width. The second BYTE and second WORD of each entry is the byte 24 bits offset from the beginning of the image to the character bitmap. The number of entries in the table is calculated as ((LastChar - FirstChar) + 1.

Font Bitmap

This field contains the character bitmap definitions. Each character is stored as a contiguous set of bytes. Each bit represents one pixel. Pixels are stored left-to-right, up-to-bottom.

Output Image and Font Data Formats > Font Image Format


Generating Reduced Font Tables

Previous
Generating Reduced Font Tables

When using a font filter, the generated font table will only include characters in the strings section of the filter file (see Font Filter File Format for details). To maintain the character ID's of the standard ASCII character table use the special string label "include" and include all the characters in the string from character ID 32 to 127.

Copy Code
include:    " !#$%&'()*+`-.,/:;<=>?@[\]^_{|}~"    //
include:    1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ  //
include:    abcdefghijklmnopqrstuvwxyz // the standard ASCII character set from ID's 32 - 127

This will generate the font table with the ASCII characters with ID from 32 to 127. Doing this enables the user to refer to each character in the application code in a normal fashion as shown in the example code below:

Copy Code
static char StringName[] = "Hello World";

However, if the characters included are not the complete set of the 32 to 127 character IDs, the generated font table may change the character ID's of some or all the characters. For example:

Copy Code
include:    1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ    //
include:    abcdefghijklmnopqrstuvwxyz // not the complete standard ASCII character set from ID's 32 - 127

The generated font table will assign a character ID of 33 to '0' (character zero) and not 48 as seen from the ASCII table. The reason is that the range of characters from '!' to '/' was not included. The utility will remove the unused characters and move the next character to the location of the first removed character. The scheme will be performed on all characters thus the generated font table will have a completely new character IDs. When this happens, the code above will not work since the C30 or C32 compiler assumes that the string "Hello World" will use the standard character IDs of all the characters. The code must be modified to this form:

Copy Code
XCHAR HelloStr[] = {0x0032,0x0049,0x0050,0x0050,0x0053,0x0020,
                    0x0041,0x0053,0x0056,0x0050,0x0048, 0x0000}; //"Hello World";

If no other characters in the ASCII set will be used other than the characters that comprises the "Hello World" string it will be best to use a string label to define the string "Hello World" in the font filter file.

Copy Code
HelloWorldStr:    Hello World      // generate only these characters in the font table

The generated reference file will contain this declaration:

Copy Code
XCHAR HelloStr[] = {0x002B,0x0034,0x0037,0x0037,0x0038,0x0020,
                    0x0030,0x0038,0x003A,0x0037,0x0033,0x0000}; // using reduced font table

This method frees the user from manually calculating the converted character ID's.

Notice the 0x0020 is the space character. This is the only character that will maintain the character ID since by default the utility always start from the space character. Control characters are omitted from the generated table.

Examples > Generating Reduced Font Tables


Contents

Contents
SW License Agreement
Release Notes
User Interface
Menu Bar
Tool Bar Buttons
Resource Table
Status
Using the Utility
Adding Images to the Conversion List
Adding Installed Fonts to the Conversion List
Adding Fonts from Files to the Conversion List
Adding Palettes to the Conversion List
Removing Item from the Conversion List
Saving and Loading Projects
Settings
Converting
Converting into C file
Conversion into Intel Hex File
Converting into Binary file
Conversion into Intel HEX in EDS Space
Generating a Palette from Bitmap Images
Input and Output File Formats
Font Filter File Format
Font Reference File Output
External Memory Reference Output
Output Image and Font Data Formats
Output Bitmap Image Format
Font Image Format
Examples
Generating Reduced Font Tables


Index

Index
A | C | E | F | G | M | O | R | S | T | U
A
Adding Fonts from Files to the Conversion List
Adding Images to the Conversion List
Adding Installed Fonts to the Conversion List
Adding Palettes to the Conversion List
C
Conversion into Intel Hex File
Conversion into Intel HEX in EDS Space
Converting into Binary file
Converting into C file
E
External Memory Reference Output
F
Font Filter File Format
Font Image Format
Font Reference File Output
G
Generating a Palette from Bitmap Images
Generating Reduced Font Tables
Graphics Resource Converter
M
Menu Bar
O
Output Bitmap Image Format
R
Release Notes
Removing Item from the Conversion List
Resource Table
S
Saving and Loading Projects
Settings
Status
SW License Agreement
T
Tool Bar Buttons
U
User Interface


Contents | Index
Next
Graphics Resource Converter

The Graphics Resource Converter converts images, bitmaps (BMP extension) and JPEG (JPG or JPEG extension), fonts, operating system's installed fonts or True Type fonts directly from files (TTF extension), binary files into formats to be used with Microchip Graphics Library. Bitmap and fonts are converted to a new optimized encoding for PIC microcontroller usage while the JPEG encoding of JPEG images are maintained. The converter can also be used to create color palettes used by Microchip's graphics module based upon GIMP palettes or bitmaps.

Fonts maybe a copyrighted material so please ensure that you have the rights to use it. You may find free fonts distributed under Open Font License (OFL) agreement. Some of the fonts distributed under OFL may be found here [image] http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=OFL_fonts.

Importing fonts into application can be performed in two ways. The first method is to identify a range of characters that you want to use and create a font table starting from the first character up to the last character in the range. The second method is to create a character filter file and based on the filter create a reduced character font table. The second method is effective in implementing multi-language applications using only a fraction of the memory required for a full font table implementation. This is especially true for Asian fonts such as Chinese, Japanese and Korean fonts.

Importing images also requires a step to convert images to BMP or JPEG format if the original format is of a different type. Multiple image editors that convert other formats to BMP or JPEG format are readily available from software vendors. Microsoft’s Paint application is one such image editor. For advanced image editing using an application called GIMP ( [image] www.gimp.org) is recommended because it supports capability to do generate optimized color palette for image which can reduce image size.

Importing binary files requires the file to have a .bin extension. Any file to convert in a raw binary format can be renamed to have the .bin extension and loaded into the converter.

Creating a palette can be done in a number of ways, GIMP palette or bitmaps. You can have the converter generate a palette based on the bitmaps that are currently loaded into the resource table. The converter will re-format the bitmaps to use the generated palette table.

Graphics Resource Converter