private string sample17(ICanvasRenderingContext2D ctx) { // create new image object to use as pattern IImageData img = new ImageData(); img.src = @"wallpaper.png"; // create pattern object ptrn = ctx.createPattern(img, "repeat"); ctx.fillStyle = ptrn; ctx.fillRect(0, 0, 150, 150); return @"Originals\Images\sample17.png"; }
private string PatternAndTransformation(ICanvasRenderingContext2D ctx) { // create new image object to use as pattern IImageData img = new ImageData(); img.src = @"wallpaper.png"; // create pattern object ptrn = ctx.createPattern(img, "repeat"); ctx.translate(50, 0); ctx.rotate(Math.PI*2/(6)); ctx.fillStyle = ptrn; ctx.fillRect(0, 0, 150, 150); return @"Originals\Images\PatternAndTransformation.png"; }