Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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
You can’t perform that action at this time.