g. Restore Defaults

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 09 - Setting Graphics Context >

g. Restore Defaults

This section shows how to restore Backgroundcolor, BackgroundGradient, AngleType and DefaultContext to its default values using the SetDefaultContext() command.



Command Prototype


uint16_t SetDefaultContext()






void setup()


   int centerX = 800/2;


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



  /* Start building a screen frame */



  /* Select angle unit */




   CleO.LineXY(400, 100, 60);


 /* Restore default context */



   CleO.StringExt(FONT_MEDIUM, centerX, 300, WHITE, MM, 0, 0, "Default Context");


  /* 45 will be treated as degree instead of FURMANS */


   CleO.LineXY(400, 350, 60);


  /* Display completed screen frame */




void loop() { }





The above code snippet draws a line with FURMANS angle at (400,100) then default context is restored using the SetDefaultContext()command. Later a line is drawn with the same value of 45 but this time, since the context is restored, it will be treated in degree.





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