HTML5 Canvas high-fidelity 3D fabric effects, html5canvas

Source: Internet
Author: User

HTML5 Canvas high-fidelity 3D fabric effects, html5canvas

The HTML5 specification introduces many new features. One of the most promising features is the Canvas Element.JavaScriptThe method of drawing a graph is very powerful. Next we will share with you the effect of a 3D cloth pattern drawn by HTML5 Canvas.

Tip: to ensure the best results, visit modern browsers such as IE10 +, Chrome, Firefox, and Safari.

 

 

Demo of plug-in download Effect

 

Articles you may be interested in
  • 10 useful results in Web development [Source Code download]
  • Excellent jQuery Ajax paging plug-ins and tutorials carefully selected
  • 12 amazing creative 404 error page Designs
  • Let the website get started! 12 excellent jQuery animation plug-ins
  • Amazing 8 HTML5 & JavaScript Special Effects

 

Link to this article: HTML5 Canvas highly imitation and Realistic 3D cloth pattern effect

Source: Dream sky ◆ focus on front-end development technology ◆ share web design resources


Whether html5 canvas is a bitmap or a vector image

The image drawn by canvas is a bitmap.

Do a test: Use canvas to draw a simple image, and then enlarge the webpage. You will see that the image and text in the canvas will be distorted (one point will become larger)

<Html>
<Head>
<Title>
Canvas Example
</Title>
<Script type = "text/javascript">
Function loader (){
Var canvas = document. getElementById ('canvas ');
Var canvas1 = canvas. getContext ('2d ');

// Rectangles
Canvas1.fillStyle = "rgba (0, 0,200, 1 )";
Canvas1.fillRect (30, 30, 75, 70 );

Canvas1.font = 'italic 40px sans-serif ';
Canvas1.strokeText ("Hello! ", 50, 50 );
}
</Script>
</Head>
<Body onload = "loader ()">
<H1> Canvas Example <Canvas id = "canvas" width = "300" height = "300">
</Canvas>
</Body>
</Html>

Html5 canvas Problems

The reason is that your browser card and image are not read. Wait a while, or use the code I wrote.

<! Doctype html>
<Html>
<Body>
<Head>

<Canvas id = "myCanvas" width = "200" height = "100" style = "border: 1px solid # c3c3c3;">
Your browser does not support the canvas element.
</Canvas>

<Script type = "text/javascript">

Window. onload = function (){
Var c = document. getElementById ("myCanvas ");
Var cxt = c. getContext ("2d ");
Var img = new Image ();
Img. src = "www.w3school.com.cn/ I /eg_flower.png ";
Cxt. drawImage (img, 0, 0 );
}
</Script>
</Head>
</Body>
</Html>

Related Article

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.