
Deseń 'no-repeat’
Listing
var cv = document.getElementById("canvas");
var ctx = cv.getContext("2d");
var image = new Image();
image.onload = function() {
var pattern = ctx.createPattern(image, 'no-repeat');
ctx.rect(0, 0, cv.width, cv.height);
ctx.fillStyle = pattern;
ctx.fill();
};
image.src = "images/cegla.png";
