https://www.studytonight.com/post/captu ... avascript#
I get an image on the screen in the object #pic_display:
This is the part of proc CustomCode:
Code: Select all
function takepicture() {
var context = canvas.getContext('2d');
if (width && height) {
canvas.width = width;
canvas.height = height;
context.drawImage(video, 0, 0, width, height);
var data = canvas.toDataURL('image/png');
photo.setAttribute('src', data);
$('#pic_display').attr('src',data); // is OK - I see captured img
} else {
clearphoto();
}