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