首页 > 解决方案 > 如何使用 js 从 Web 浏览器中捕获图像或选择图像文件

问题描述

我正在尝试捕获图像或将现有图像上传到我的网站,当我从自动选择的笔记本电脑网络摄像头拍摄照片时,我尝试了几种方法,但它们都不起作用,只想选择文件

<input type="file" accept="image/*" capture>
<!-- and this one -->
<input type="file" accept="image/*" capture="camera">
<input type='file' id="imgInp" />
<img id="blah" src="#" alt="your image" />

它们不起作用,我在 google chrome 浏览器中尝试,但什么也没显示?!

标签: javascripthtmlwebcam-capture

解决方案


推荐阅读