asp.net 中怎么调摄像头并保存上传图片 急求ASP.NET操作摄像头取个图片到网页上 ,并上传到服务器上 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 web平台开发工具都是“反流氓软件”的,因此不可能提供此功能。这当然需要asp.net无关的开发了。 Silverlight 4 是你的答案 csdn中的上传图像好像可以从摄像头获取出来的吧 纯asp.net不能操作客户端摄像头,一般是用插件或flash、sliverlight,csdn用的是flash Flex2中的代码片段,用于实现拍照功能. 1 private function getSnapshotJPEG():void { 2 var jpegEnc:JPEGEncoder = new JPEGEncoder(100); 3 var jpegData:ByteArray = jpegEnc.encode(cameraStream.getSnapshotBitmapData()); 4 5 //var req:URLRequest = new URLRequest('http://127.0.0.1/php/UploadImg.php'); 6 var req:URLRequest = new URLRequest('http://127.0.0.1/dotnet/FlexWebCam.aspx'); 7 var loader:URLLoader = new URLLoader(); 8 saveImageListeners(loader); 9 //loader.addEventListener('complete', onComplete);10 11 req.contentType = 'applicatoin/octet-stream';12 //req.contentType = 'multipart/form-data';13 req.method = URLRequestMethod.POST;14 req.data = jpegData;15 16 try {17 loader.load(req); 18 } 19 catch (error:Error) {20 trace('unable to load request');21 }22 23 function saveImageListeners(dispatcher:IEventDispatcher):void {24 dispatcher.addEventListener(Event.COMPLETE, onComplete);25 }26 27 function onComplete(e:Event):void {28 //navigateToURL(new URLRequest("http://127.0.0.1/php/UploadImg.php"),"_self");29 var loader:URLLoader = URLLoader(e.target);30 trace('返回数据:'+loader.data);31 } 32 }FLEX实现抓取图像,通过JPEGEncoder转换成ByteArray,返回.剩下的工作简单了,获取图像保存而 已php 实现1$fp = fopen('php.jpg', 'wb');2fwrite($fp, $GLOBALS['HTTP_RAW_POST_DATA']);3fclose($fp);C# 实现1 System.Drawing.Image img = System.Drawing.Image.FromStream(Request.InputStream);2 img.Save(@"D:\path\asp.jpg"); 这里有源代码,可以实现抓拍,比flash强大,支持本地保存,本地编辑。http://peihexian.javaeye.com/blog/710177 http://wenku.baidu.com/view/8aad1c4ac850ad02de804109.html 1.FLEX or SilverLightA simple example of how to Capturing the Webcam in Silverlight 4SilverLight : http://www.silverlightshow.net/items/Capturing-the-Webcam-in-Silverlight-4.aspx2.ActiveX这个会引发浏览器的安全策略限制.以上都不在ASP.NET的范畴 有做过类似的 不过是winform程序抓拍 然后根据web services上传到服务器 服务器网站在根据IIS 虚拟目录找到对应图片 去,51aspx有这么源码,使用flash做的 求一个联合查询语句,诚心求教!谢谢 求一个GridView与行和列相关的求值算法 哪里错了求改下 大家帮我看看,登陆代码? xml绑定GridView中只显示一条记录? 为什么,学习中希望大家多帮忙!!! 100分求RDLC报表多表头问题 求aspx内插入透明falsh的代码 asp.net项目运行时快速跳出浏览器快速关闭浏览器是怎么回事 从数据库提数据。加在原先的DropDownList里面的数从值上。并显示. 在线等本机调试本机没装net编译工具 FLEX 入门 急 求救 请高手来结贴啊!!!
2 var jpegEnc:JPEGEncoder = new JPEGEncoder(100);
3 var jpegData:ByteArray = jpegEnc.encode(cameraStream.getSnapshotBitmapData());
4
5 //var req:URLRequest = new URLRequest('http://127.0.0.1/php/UploadImg.php');
6 var req:URLRequest = new URLRequest('http://127.0.0.1/dotnet/FlexWebCam.aspx');
7 var loader:URLLoader = new URLLoader();
8 saveImageListeners(loader);
9 //loader.addEventListener('complete', onComplete);
10
11 req.contentType = 'applicatoin/octet-stream';
12 //req.contentType = 'multipart/form-data';
13 req.method = URLRequestMethod.POST;
14 req.data = jpegData;
15
16 try {
17 loader.load(req);
18 }
19 catch (error:Error) {
20 trace('unable to load request');
21 }
22
23 function saveImageListeners(dispatcher:IEventDispatcher):void {
24 dispatcher.addEventListener(Event.COMPLETE, onComplete);
25 }
26
27 function onComplete(e:Event):void {
28 //navigateToURL(new URLRequest("http://127.0.0.1/php/UploadImg.php"),"_self");
29 var loader:URLLoader = URLLoader(e.target);
30 trace('返回数据:'+loader.data);
31 }
32 }FLEX实现抓取图像,通过JPEGEncoder转换成ByteArray,返回.剩下的工作简单了,获取图像保存而 已php 实现
1$fp = fopen('php.jpg', 'wb');
2fwrite($fp, $GLOBALS['HTTP_RAW_POST_DATA']);
3fclose($fp);C# 实现1 System.Drawing.Image img = System.Drawing.Image.FromStream(Request.InputStream);
2 img.Save(@"D:\path\asp.jpg");
http://peihexian.javaeye.com/blog/710177
A simple example of how to Capturing the Webcam in Silverlight 4
SilverLight : http://www.silverlightshow.net/items/Capturing-the-Webcam-in-Silverlight-4.aspx2.ActiveX
这个会引发浏览器的安全策略限制.以上都不在ASP.NET的范畴