HTML5 Canvas tag application for daily training-place Canvas on the page-

Source: Internet
Author: User
Today we are going to learn Canvas, the most eye-catching label in HTML5. I believe many people are learning HTML5 for Canvas. This section describes how to use Canvas labels. Before learning it, let's add a little bit of knowledge, although it's a little theoretical ,...,. Today we are going to learn Canvas, the most eye-catching label in HTML5. I believe many people are learning HTML5 for Canvas. This section describes how to use Canvas labels.
Before learning it, let's add a little bit of knowledge. Although it's a little theoretical, the following things are useful.
Basic knowledge of Canvas labels:
Canvas is a newly added important element in html5. it is used to draw images. Placing a canvas element on a page is equivalent to placing a "canvas" on the page. If you have done Flash, you can understand it as "stage" in Flash ", we can describe it here.
It must be noted that we do not draw on the canvas with the mouse. In fact, the canvas element is only a colorless and transparent area (just like a p with only the width and height without background). You need to use JavaScript to write scripts to draw in it.
Q:Some HTML5 websites are also canvas. Why can I draw images with the mouse over it?
A:This is because the JS script captures the mouse path for painting. It is not really the mouse for painting, but visually it is the mouse for painting. Even from the perspective of programming, we can't say that the mouse is painting, but the mouse path and Action captured, and the program is painting.
Place a canvas label on the page
Generally, a basic canvas consists of the property id, width, and height. The Code is as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.