asp.net使用網路攝影機拍照

來源:互聯網
上載者:User
視頻拍照的flash檔案

import it.sephiroth.mloaderWindow
import it.sephiroth.PrintScreen


myCam  =  Camera. get ();
myCam.setMode( 390 ,  290 ,  10 );
my_video.attachVideo(myCam);
var loader:mloaderWindow  =   this .createClassObject(mloaderWindow,  " loader " ,  10 ,  ... {_x:-1000, _y:-1000} )
// loader.setStyle("borderColor", 0x006699)

var listener:Object  =   new  Object();


listener.onProgress  =  function(target:MovieClip, loaded:Number, total:Number) ... {
 var perc = Math.round((loaded/total)*100)
 loader.label = "Sending... " + perc + "%"
 loader.value = perc
}

listener.onComplete  =  function(target:MovieClip, load_var:LoadVars) ... {
 loader.label = "Sending..."
 load_var.send("makepic.aspx", "_self", "POST")
 loader.close()
}


function print_me() ... {
 var mc_x = 15;
 var mc_y = 15;
 my_video.attachVideo(null);
 pn = new PrintScreen(); 
 pn.addListener( listener ); 
 pn.print(_root, 0, 0, 390, 290, mc_x, mc_y) 
 loader.label = "輸出中... 0%"
 loader.open(true, true, true); 
}

 

asp.net 擷取flash拍照程式的資料: 

private   bool  CreateImage( string  Path)
     ... {

        int w = 0;
        int h = 0;

        try
        ...{
            w = int.Parse(Request.Form["width"]);
            h = int.Parse(Request.Form["height"]);
        }
        catch (Exception ee)
        ...{
            Response.Write(ee.Message);
            return false;
        }

        Bitmap newmap = new Bitmap(w, h);
        int rows = 0;
        int cols = 0;

        Graphics gp = Graphics.FromImage(newmap);
        gp.Clear(Color.White);
        ImageCodecInfo myImageCodecInfo;
        System.Drawing.Imaging.Encoder myEncoder;
        EncoderParameter myEncoderParameter;
        EncoderParameters myEncoderParameters;
        myImageCodecInfo = ImageCodecInfo.GetImageEncoders()[1];
        myEncoder = System.Drawing.Imaging.Encoder.Quality;
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.