Canvas basic knowledge
context: context is an object that encapsulates many drawing functions. The method to obtain this object is var context =canvas.getContext("2d");
Perhaps this 2d has aroused everyone’s imagination. , but I regret to tell you that HTML5 does not provide 3D services.
There are two methods for drawing images using canvas elements, namely
context.fill()//Fill
context.stroke()//Draw the border
style: Before drawing graphics, you must set the drawing style
context.fillStyle//Fill style
context.strokeStyle//Border style
context.lineWidth//Graphic border Width
Color representation:
Directly use the color name: "red" "green" "blue"
Hexadecimal System color value: "#EEEEFF"
rgb(1-255,1-255,1-255)
rgba(1-255,1-255,1-255, transparency)
It is so similar to GDI, so friends who have used GDI should be able to get started quickly