kivy learning ------ Graphics

Introduction -------- Canvas

Kivy in many graphics control is accomplished using the Canvas, it can be considered as a wireless drawing board, but also a set of drawing instructions. Painting instruction generally divided into two categories:

 · Context Instructions environmental directives

 · Vertex vertex instruction Instructions

environmental context instructions instruction does not draw anything, but will change the vertex instructions vertex instruction plotted results.

Canvas contains two branch instructions, respectively canvas.before both instructions and canvas.after group. These two sets of instructions performed before and after the canvas graphics are drawn. Before the draw will be drawn after the graphics overwritten, after the draw will be covered at the top graphic. These instructions will only be created when the user reads them.

To add the Canvas drawing instruction for a control, you need to use Canvas environmental directives.

 -------- environmental directives

Instruction is an operation environment opengl environment. You can rotate, translate and zoom canvas. You may additionally change the texture or color of the drawing.

Change the color instructions are as follows:

 

 

 

Drawing instruction --------

 

 

Operation instruction --------

Prior to the drawing canvas to add the instructions to change or delete, there may be many ways to be selected according to specific needs:

 You can create a reference and then update it to the command:

 Alternatively, you can empty canvas painting canvas and then re-:

 

 

 

Guess you like

Origin www.cnblogs.com/suyun1219/p/11424612.html