WEBRTC Learning ——— Record two: Canvas learning

Source: Internet
Author: User

Resources:

Http://bucephalus.org/text/CanvasHandbook/CanvasHandbook.html#getcontext2d

Https://developer.mozilla.org/zh-CN/docs/Web/HTML/Canvas

Http://www.w3school.com.cn/html5/html5_canvas.asp

Https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement

<canvas>is a new element of HTML5, you can use JavaScript scripts to draw graphics. For example: paint, synthesize photos, create animations and even real-time video processing and rendering.

Mozilla programs are supported from Gecko 1.8 (Firefox 1.5) <canvas> . It was first introduced by Apple for OS X Dashboard and Safari. Internet Explorer starts with IE9 <canvas> , and older versions of IE can be supported by introducing scripts from Google's Explorer Canvas Project <canvas> . Chrome and opera are also supported <canvas> .

<canvas> elements can also be used by WebGL as a hardware acceleration for 3D graphics on Web pages .

Example

This is a CanvasRenderingContext2D.fillRect() simple example of how to use it.

Html
<canvas id="canvas"></canvas>
Javascript
var canvas= document.getElementById("Canvas");var ctx= Canvas.GetContext("2d");
GetContext returns an object of CANVASRENDERINGCONTEXT2D.
Displays a two-dimensional picture in the canvas container by manipulating the object. Https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2Dctx. FillStyle = "Green"; CTX. FillRect(Ten, ten, + );

WEBRTC Learning ——— Record two: Canvas learning

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.