c. Setting Screen Background with Bitmap/Tiled

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 09 - Setting Graphics Context >

c. Setting Screen Background with Bitmap/Tiled

This section shows how to set a screen background image using the SetBackgroundImage() command.



Command Prototype


uint16_t SetBackgroundImage(int16_t Handle, int16_t Mode)





Handle received from LoadImageFile() command


Centered or Zoomed or Tiled






void setup()


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



/* Get handle to an image */

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


/* Set screen background */

 CleO.SetBackgroundImage(h, TILED);


/* Release image handle */



/* Start building a screen frame */



/* Display completed screen frame */




void loop() {}





The above code snippet shows how the SetBackgroundImage() command is used to set the screen background image in tiled mode.

Start() and Show() commands are used to draw a frame on the screen.


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 -