canvas教程

Taking Picture From Webcam Using Canvas(2)

字号+ 作者:H5之家 来源:H5之家 2016-08-30 11:00 我要评论( )

Each time you call createObjectURL(), a new object URL is created, even if you’ve already created one for the same object. Each of these must be released by calling URL.revokeObjectURL() when you no

Each time you call createObjectURL(), a new object URL is created, even if you’ve already created one for the same object. Each of these must be released by calling URL.revokeObjectURL() when you no longer need them. Browsers will release these automatically when the document is unloaded; however, for optimal performance and memory usage, if there are safe times when you can explicitly unload them, you should do so.

Now, we can take a picture from our webcam, getting its content via a data URL. Here is the result of previous code:

In case we need to save the image server-side, we just need to send the canvas.toDataUrl() result using AJAX for instance.

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • Canvas实现拖拽粘性小球

    Canvas实现拖拽粘性小球

    2016-07-25 14:01

  • JavaFX: Canvas/Nashorn Demo of the Week #2

    JavaFX: Canvas/Nashorn Demo of the Week #2

    2016-07-23 10:00

  • Canvas画图基础

    Canvas画图基础

    2016-07-22 15:03

  • javascript学习笔记整理(对象基础)

    javascript学习笔记整理(对象基础)

    2015-11-11 19:53

网友点评
i