Created
November 15, 2013 15:09
-
-
Save dagingaa/7485786 to your computer and use it in GitHub Desktop.
This file contains 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
// javascript | |
var takeSnapshot = function (clientId) { | |
var videoElem = document.getElementById(clientId); | |
var canvas = document.getElementById(“chat-paint-canvas”); | |
var ctx = canvas.getContext(‘2d’); | |
ctx.drawImage(videoElem, 0, 0, 30, 30); | |
return canvas.toDataURL(); | |
}; | |
// html | |
<canvas height=”30” width=”30” id=”chat-paint-canvas” style=”display: none”></canvas> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment