Add files via upload

This commit is contained in:
Kyle
2018-08-15 21:13:54 -07:00
committed by GitHub
parent cf77915fef
commit 03e48dedca
14 changed files with 572 additions and 0 deletions

13
KCI/data/scripts/mask.js Normal file
View File

@@ -0,0 +1,13 @@
var mask = document.createElement("canvas")
var maskContext = mask.getContext("2d")
function drawMask(img, x, y, width, height, imgMask){
mask.width = width
mask.height = height
maskContext.clearRect(0, 0, width, height)
maskContext.globalCompositeOperation = "source-over"
maskContext.drawImage(imgMask, 0, 0, width, height)
maskContext.globalCompositeOperation = "source-atop"
maskContext.drawImage(img, 0, 0, width, height)
card.drawImage(mask, x, y, width, height)
}