Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,


Actually i have done capturing photo in web application in asp.net through flash...and it is working for me in firefox....but it is not working in chrome....what i should do....


please help me...
Posted
Comments
_Amy 12-Jun-13 8:06am    
Can I see your code? Working in firefox but not in chrome does not explains much about the problem. Click on Improve question and provide more information about the problem you are facing.
Muied Ahmad 9-Nov-17 23:55pm    
var pageUrl = "WebCamImageCapture.aspx";

$(function () {
jQuery("#webcam").webcam({
width: 320,
height: 240,
mode: "save",
swffile: "Webcam_Plugin/jscam.swf",
debug: function (type, status) {

$('#camStatus').append(type + ": " + status + '<br /><br />');
},
onSave: function (data) {
$.ajax({
type: "POST",
url: pageUrl + "/GetCapturedImage",
data: '',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
$("[id*=imgCapture]").css("visibility", "visible");
$("[id*=imgCapture]").attr("src", r.d);
},
failure: function (response) {

}
});
},
onCapture: function () {
webcam.save(pageUrl);
}
});

});
function Capture() {

webcam.capture();

return false;
}



Live Camera
Captured Picture

<object id="webcam">



<asp:Image ID="imgCapture" runat="server" Style="width: 320px;
height: 240px;" />



<asp:Button ID="btnCapture" Text="Capture" runat="server" OnClientClick="return Capture();" />

Member 9155255 12-Jun-13 8:31am    
This is what actually i got code from Google....it is working in firefox but not in chrome...


1) Create a new web application project and copy the WebcamResources folder from the attachments.

2) Create a new page named "Default.aspx" page add the following code,


<object width="405" height="190"
param name="movie" value="WebcamResources/save_picture.swf"
embed src="WebcamResources/save_picture.swf" width="405" height="190" >
</object>



The above code is to place the flash object in your webpage, which is used to capture images from the webcam.

3) Create another ASP.NET web page and name it "ImageConversions.aspx"

This page name is should be of same name if you use the attached swf file. Whenever the capture image button is clicked, then it redirectd
to "ImageConversions.aspx" page. So the file name matters!

4) In this ASP.NET page, add the following C# code in the pageload or create a
separate method.


string strPhoto = Request.Form["imageData"]; //Get the image from flash file
byte[] photo = Convert.FromBase64String(strPhoto);
FileStream fs = new FileStream("C:\\Webcam.jpg", FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter br = new BinaryWriter(fs);
br.Write(photo);
br.Flush();
br.Close();
fs.Close();



Above example written in C# will convert the byte code into image and store the image in local C: drive. Even though the code sample is given in C#, if you are a VB.NET guy, you can easily convert this to VB.NET and write your web cam application in VB.NET.
Member 9155255 14-Jun-13 7:59am    
can anyone tell me capturing photo from usb webcam through asp.net web application using silverlight....please give me demo example....here i dont have basic knowledge regarding silverlight....i have done by using fash....now i want in silverlight....please help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900