a. Loading Bitmap Files

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 03 - Displaying Bitmaps & Icons >

a. Loading Bitmap Files

To draw an image using bitmap, you are required to load the bitmap file and get the handle. This section shows how to load a bitmap file and get the handle that can be passed to the Bitmap() command to draw an image. LoadImageFile() is the command used to load the picture file.



Command Prototype


uint16_t LoadImageFile(const char* FileName, int16_t Format);





Absolute path of bitmap file


0 - reserved






void setup()


 /* Initialize CleO - needs to be done only once */



/* Get the handle for the image */

 int16_t im = CleO.LoadImageFile("@Pictures/ctg.jpg", 0);


/* Start building a screen frame */



/* Draw a bitmap at (0, 0) using im handle */

 CleO.Bitmap(im, 0, 0);


/* Display completed screen frame */




void loop()







In the above code snippet, after calling LoadImageFile() command, a handle (im) will be generated for use with other functions to perform various operation on the bitmap file "ctg.jpg."


Use the @ symbol only when performing the file operation from the eFlash and not from the SD Card.





Here is the output displayed upon executing the above code snippet -


Loading Image Files