Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've developed web application using visual studio 2008 and right at this moment I would like to add one more interface which can scan QR code using smart phone camera to retrieve data.

Can anyone help me to give me an idea or sample source to do this?

Thanks in advance.
Posted

See, for example, this CodeProject article: How to Build a C# Barcode/QR Code Scanner by Using Your USB Camera[^].

You can find a lot more.

You can use WebRTC for sending media from browser. Start here:
http://en.wikipedia.org/wiki/WebRTC[^],
http://www.html5rocks.com/en/tutorials/webrtc/basics[^],
https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC[^],
http://www.w3.org/TR/webrtc[^].

At the time of writing, WebRTC is supported by all major browsers but not Safary and not IE (not surprisingly).
I want to warn you against the "usual" IE work-around: ActiveX embedded in the browser. This is utterly unsafe. For some safety-savvy users, learning that you are doing those dirty tricks with ActiveX can be enough to blacklist your site, for some very good reasons.

—SA
 
Share this answer
 
Comments
Alamgir Hossan 28-Jan-16 6:27am    
Hi Sergey,
I've used getUserMedia to capture image using SmartPhone camera. It's working, but I want to scan QR code from ID card using camera which will be live. There are so many apps developed in android and checked with that which is working. Is it possible to develop such types of scanner using JavaScript/HTML5/ASP .NET?

Thanks for your suggestions.

Alamgir
What you need to do is to capture the barcode image on the client side, and send it to the server side. Then decode the barcode on the server side, and send the result back to the Web client. Here is an HTML5 solution for capturing and uploading images using the smartphone camera: Take a Photo and Upload it on Mobile Phones with HTML5[^]
 
Share this answer
 
Comments
Alamgir Hossan 28-Jan-16 6:23am    
Hi Xiao,
I've tried using your suggestion, but reader can't decode the QR Image. I would like to mention here that I'm trying to read QR code from ID card after capturing the image from that card. Is there any other alternative way to scan the QR code?

Thanks,

Alamgir
Xiao Ling 1-Feb-16 1:31am    
I have no idea why your reader couldn't decode the QR image. You can try the sample - Read Barcode in ASP.NET Web App: http://www.dynamsoft.com/Downloads/Dynamic-Barcode-Reader-Sample-Download.aspx?SampleID=79

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