<canvas> Backup content </canvas>
.Backup the contentThis content is mainly displayed on a canvas that the browser does not support.- The canvas tag background is transparent by default
- Properties on the Canvas tag
width
,height
Can only be set onThe numericalThe setting unit is invalid and will not be recognized. The size is pixels. - Canvas has two sets of dimensions, one for the element itself and the other for the drawing surface object. Setting the width and height on the label sets the width and height on both dimensions at the same time, by setting the attributes on the element in the CSS to give the element itself and the drawing surface object the same size as before. The browser will automatically stretch the drawing object to the size of the Canvas tag, and the drawing object will be stretched.
- Canvas tag has two attributes and three methods:
width
|height
Two attributes;getContext
| – returns a graphics environment objecttoDataURL
| – return data addresstoBlob
– Creates a blob object method that represents the Canvas image file canvas.getBoundingClientRect
Returns a drawing surface object in canvas, where width is the size of the drawing surface object.- Canvas adopts the immediate mode, after drawing, it will be displayed on canvas immediately, but it will immediately forget the previous drawing content, that is to say, cNAVAS will cover only the content data of the current drawing object. You can use
getImagedData
andputImageData
Saves and restores drawing surface objects in the drawing environment. - Basic data:
Radians = Degrees * math.pi / 180
.Angle = Radians * 180 / math.pi