Bilder zeichnen
Var image = new Image ();
Image.src = ”http://img4.duitang.com/uploads/item/201406/25/20140625182321_4Mtau.thumb.700_0.jpeg”;
Image.onload = function () {}
Context.drawimage (Bild, x, y);
Context.drawimage (Bild, x, y, w, h);
Context.drawiamge (Bild, SX, SY, SW, SH, DX, DY, DW, DH);
Bildfliesen
Var pat = context.createPatters (Bild, "Wiederholung");
Context.fillStyle = pat;
Context.FillRect (0,0,400.300);
Bildschnürung
Zeichnen Sie zuerst den Weg
Context.clip ();
<html> <kopf> <meta charset = "utf-8"> <titels> Bilder zeichnen </title> <meta name = "viewPort" content = "width = Gerätebreite, initiale scale = 1, minimal scale = 1, maximal scale = 1, user-scalable = No"/> </head> </body> <body> <body> <body> <body> <body> <canvas idevas ide = "canvas" can </body> <body> <body> <canvas id = "canvas" canvas "canvas id type = "text/javaScript"> var ocanvas = document.getElementById ("canvas"); var context = ocanvas.getContext ("2d"); context.fillStyle = "#Ededed"; Context.FillRect (0, 0, 500, 500); // das Bild zeichnen var img = new Image (); // erstellen img.src = "img/01.jpg"; // Bildadresse img.onload = function () {// Alle Bildinformationen laden Seitenkontext.Drawimage (IMG, 0, 0); // IMG -Objekt; 0,0: IMG -Koordinaten -Startpunkt}; </script> </body> </html>