UTFT_GHL - The most comprehensive Font IC support package to date! Exclusively distributed by ColdTears Electronics. Graham Lawrence proudly associated with ColdTears Electronics. UTFT_GHL - The most comprehensive Font IC support package to date! Exclusively distributed by ColdTears Electronics. Graham Lawrence proudly associated with ColdTears Electronics. UTFT_GHL - The most comprehensive Font IC support package to date! Exclusively distributed by ColdTears Electronics. Graham Lawrence proudly associated with ColdTears Electronics.

Programming guide (work in progress)

Here you will find a guide to the commands provided by UTFT_GHL.

Image related commands

Preload(location);

Note

The following commands can be used with a transparent background, however this should only be done if you are drawing on a screen which is not black since there is a significant reduction in drawing speed. Drawing speed is not however affected if used in combination with rotation, as rotation already suffers from reduced drawing speed for the same technical reasons.

For transparent backgrounds, simply use the following UTFT command :-

myGLCD.setBackColor(VGA_TRANSPARENT);

Load_image(location);

Load_image(X, Y, location);

Load_image(X, Y, location, degrees, rox, roy);

Text related commands

 

Usage:-

int result=CTE_LCD.Preload(location);

Using Preload can be useful if you wish to know the size of an image before you draw it.

returns 0 for the first unused index slot

returns 2 for a valid image that is too large for the selected screen orientation

for example an 800x480 image cannot be drawn in PORTRAIT mode as screen is 480x800

returns 5 for a normal font

returns 7 for a wide font

returns 15 for an empty index slot

return >=0x2000 for a valid image

Example :-

int result=CTE_LCD.Preload(location);

If (result >=0x2000) {

width = CTE_LCD.Image_Width;

height = CTE_LCD.Image_Height;

}

 

int result=CTE_LCD.Load_image(location);

If you just want to draw a single large image centered on screen (in both axes) this is the command you will use.

In addition to the return codes specified for Preload, Load_image

returns 1 if the image was drawn successfully

 

int result=CTE_LCD.Load_image(X, Y, location);

This is the standard draw image command, simply drawing the specified image at the specified coordinates.

Same return codes previously noted.

 

int result=CTE_LCD.Load_image(X, Y, location, degrees, rox, roy);

Rotation-example

Rotation is complicated, hence the image. The top row is shown rotated by 90 degrees, the middle row rotated by 180 degrees and the bottom row is rotated by 270 degrees.

All images share common coordinates of 0,0 and rotation angle, so why do we have the various placements? The centre of rotation (rox, roy) is what affects the resulting placement.

As you are probably aware, the majority of the icons contained in the Font IC are 42x42 pixels, this is significant when it comes to understanding the following commands.

Top row (moving down the commands moves right in the picture) :-

CTE_LCD.Load_image(0,0,74,90,0,0);
CTE_LCD.Load_image(0,0,74,90,0,42);
CTE_LCD.Load_image(0,0,74,90,42,0);
CTE_LCD.Load_image(0,0,74,90,42,42);
CTE_LCD.Load_image(0,0,74,90,21,21);

Middle row :-

CTE_LCD.Load_image(0,0,74,180,0,0);
CTE_LCD.Load_image(0,0,74,180,0,42);
CTE_LCD.Load_image(0,0,74,180,42,0);
CTE_LCD.Load_image(0,0,74,180,42,42);
CTE_LCD.Load_image(0,0,74,180,21,21);

Bottom row :-

CTE_LCD.Load_image(0,0,74,270,0,0);
CTE_LCD.Load_image(0,0,74,270,0,42);
CTE_LCD.Load_image(0,0,74,270,42,0);
CTE_LCD.Load_image(0,0,74,270,42,42);
CTE_LCD.Load_image(0,0,74,270,21,21);

Of course you can rotate by any angle, and you don't have to use the corners of the image as the centre of rotation. However you need to be aware that using angles that are not divisble by 90, will result in a speckled effect with background colour showing through, as can be seen on the home page images.