Created
August 12, 2018 21:13
-
-
Save iha2/ad0397bc68af1b67129941fda056bc77 to your computer and use it in GitHub Desktop.
draw image on canvas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const drawImageOnCanvas = ( | |
videoElem: HTMLVideoElement, | |
canvasElem: HTMLCanvasElement | |
) => { | |
const ctx = canvasElem.getContext('2d') as CanvasRenderingContext2D; | |
const canvasResolution = 224; | |
ctx.drawImage(videoElem, 224, 0, size, size, 0, 0, 224, 224); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment