本文介绍了如何在我的django网络应用程序中使用客户端摄像头拍摄图像快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个django网络应用程序,我想在注册表单中提供一个选项来捕获图像,注册可以从任何客户端系统完成,当按下捕获图像按钮时,客户端系统相机应该打开并且拿图像应该存储在服务器端文件夹我怎么能做到这一点。

我认为相机应该从html页面打开并将图像发送到服务器,但我不能使用html代码打开相机。



我希望有人可能会这样做,如果是的话,请给我示例代码。

解决方案

您可以使用WebRTC进行此操作; html5rocks.com有,特别参见示例的。要将图像存储在服务器上,您必须通过AJAX上传。


I have a django web application in which i want give a option to capture the image in the registration form,"the registration can be done from any client system" when ever press the capture image button then client system camera should open and take the image should store in server side folder how can i do this.

I am thinking that camera should open from html page and send the image to server, but I am not able open camera using html code.

I hope some one might have done this if yes please give me sample code.

解决方案

You can use WebRTC for this; html5rocks.com has a nice tutorial, see especially the example of taking screenshots. To store the image on the server, you'll have to upload it via AJAX.

这篇关于如何在我的django网络应用程序中使用客户端摄像头拍摄图像快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 22:43