JavaEE - HTML5 painting

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Painting is a new function of HTML5, which was not available before. It has the effect of flash and is supported by all major browsers.

< canvas > Drawing component
The canvas element is used to draw graphics on web pages.
The HTML5 canvas element uses JavaScript to draw images on web pages.
The canvas is a rectangular area of ​​which you can control every pixel. canvas has several methods for drawing paths, rectangles, circles, characters, and adding images.

Creating the Canvas Element
Adds the canvas element to an HTML5 page.
Specify the id, width and height of the element:

image

image

image

We use the artboard to make a pattern that appears randomly

image

image

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326693833&siteId=291194637