急求ASP.NET操作摄像头取个图片到网页上 ,并上传到服务器上

解决方案 »

  1.   

    web平台开发工具都是“反流氓软件”的,因此不可能提供此功能。这当然需要asp.net无关的开发了。
      

  2.   

    Silverlight 4 是你的答案
      

  3.   

    csdn中的上传图像好像可以从摄像头获取出来的吧
      

  4.   

    纯asp.net不能操作客户端摄像头,一般是用插件或flash、sliverlight,csdn用的是flash
      

  5.   

    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");
      

  6.   

    这里有源代码,可以实现抓拍,比flash强大,支持本地保存,本地编辑。
    http://peihexian.javaeye.com/blog/710177
      

  7.   

    http://wenku.baidu.com/view/8aad1c4ac850ad02de804109.html
      

  8.   

    1.FLEX or SilverLight
    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的范畴
      

  9.   

    有做过类似的  不过是winform程序抓拍 然后根据web services上传到服务器   服务器网站在根据IIS  虚拟目录找到对应图片
      

  10.   

    去,51aspx有这么源码,使用flash做的