2009-10-28 50 views
0

我工作的一個樣品我在此網站上發現:如何捕捉從Flash到http.Net頁面的http post文件?

http://kevinmusselman.com/blog/2009/02/access-webcam-with-flash/

它抓住了網絡攝像頭&保存然後將圖像它發佈到一個頁面。

但似乎我無法捕捉到保存的圖像,即時通訊有點生鏽,所以我希望有人在這裏可以幫助我。

我在aspx頁面捕獲響應並將圖像保存在文件中。這裏是我的asp.net代碼:

if (Request.Files.Count == 0) 
      { 
       Response.Write("ERROR: No files were uploaded"); 
       return; 
      } 

      string pt = Path.Combine(PathFolder, "test.jpg"); 

      if (Directory.Exists(PathFolder)) 
      { 
       //go through all of the files and save them off 
       for (int i = 0; i < Request.Files.Count; i++) 
       { 
        Request.Files[i].SaveAs(pt); 
       } 
       Response.Write("SUCCESS"); 
      } 
+0

我是否假設flash文件通過此代碼發佈圖片? var send_lv:LoadVars = new LoadVars(); load_var.sendAndLoad(「webcam.aspx」,result_lv,「POST」); – 2009-10-28 03:11:45

回答

0

那篇文章沒有後圖像作爲一個圖像,而是將其作爲一系列領域的所謂px0..px ROWS。它們包含該行上每個像素的逗號分隔像素值。

PHP然後通過單獨遍歷每行,然後每列,並將像素設置在內存映像中,將其重建爲圖像。然後寫入磁盤。

因此,要麼重新創建PHP,要麼嘗試找到different example