Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9187697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:50:17+00:00 2026-06-17T19:50:17+00:00

I am looking to create an ASP.Net website where the user can capture an

  • 0

I am looking to create an ASP.Net website where the user can capture an image from there web camera and save it to a database on my server. I have tried using TWAIN but cannot seem to find any new cameras that support this. Same when trying to use Silverlight and WIA. Has anyone had any success in doing this?

The client computer will have whatever web camera I recommend so if you know of a model that works, please share. I have tried both Microsoft LifeCam and Logitech with no luck.

If you have done this or now how I would really appreciate some help. Thanks for you time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:50:19+00:00Added an answer on June 17, 2026 at 7:50 pm

    I was able to accomplish what I wanted by having the user install Google Chrome Frame on there computer and then using the canvas tag to get the image. Works well here’s some sample code:

        <div>
    
            <p id="status" style="color:red">
                <noscript>JavaScript is disabled.</noscript>
            </p>
    
    
            <table>
                <tr>
                    <td>
                        <input id="btnTakePicture" type="button" value="Take Picture"; />
                    </td>
                    <td>
                        <input id="btnSave" type="button" value="Save Picture"; />
                    </td>
                </tr>
            </table>
    
    
            <asp:Button ID="btnSavePicture" runat="server" Text="HiddenSave" OnClick="btnSavePicture_Click" CssClass="hiddencol"  />
    
            <asp:Panel ID="pnlHide" runat="server" style="display:none" >    
                <textarea id="eventdata" rows="18" cols="1" style="width: 100%" runat="server"></textarea>
            </asp:Panel>
    
            <script type="text/javascript">
    
                    navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
                    navigator.mozGetUserMedia || navigator.msGetUserMedia;
    
                    var webcam = (function () {
    
    
                        var video = document.createElement('video'),
                        photo = document.createElement('canvas');
    
                        function play() {
    
                            if (navigator.getUserMedia) {
    
                                navigator.getUserMedia({ video: true, audio: true, toString: function () { return "video,audio"; } }, onSuccess, onError);
    
                            } else {
    
                                changeStatus('getUserMedia is not supported in this browser.', true);
                            }
    
                        }
    
                        function onSuccess(stream) {
    
                            var source;
    
                            if (window.webkitURL) {
    
                                source = window.webkitURL.createObjectURL(stream);
    
                            } else {
    
                                source = stream; // Opera and Firefox
                            }
    
    
                            video.autoplay = true;
    
                            video.src = source;
    
                            changeStatus('Connected.', false);
    
                        }
    
                        function onError() {
    
                            changeStatus('Please accept the getUserMedia permissions! Refresh to try again.', true);
    
                        }
    
                        function changeStatus(msg, error) {
                            var status = document.getElementById('status');
                            status.innerHTML = msg;
                            status.style.color = (error) ? 'red' : 'green';
                        }
    
    
                        // allow the user to take a screenshot
                        function setupPhotoBooth() {
                            //var takeButton = document.createElement('button');
                            var takeButton = document.getElementById('btnTakePicture');
                            //takeButton.innerText = 'Take Picture';
                            takeButton.addEventListener('click', takePhoto, true);
                            //document.body.appendChild(takeButton);
    
                            //var saveButton = document.createElement('button');
                            var saveButton = document.getElementById('btnSave');
                            //saveButton.id = 'btnSave';
                            //saveButton.innerText = 'Save Picture';
                            saveButton.disabled = true;
                            saveButton.addEventListener('click', savePhoto, true);
                            //document.body.appendChild(saveButton);
    
                        }
    
                        function takePhoto() {
    
                            // set our canvas to the same size as our video
                            photo.width = video.width;
                            photo.height = video.height;
    
                            var context = photo.getContext('2d');
                            context.drawImage(video, 0, 0, photo.width, photo.height);
    
                            // allow us to save
                            var saveButton = document.getElementById('btnSave');
                            saveButton.disabled = false;
    
                            var data = photo.toDataURL("image/png");
    
                            data = data.replace("image/png", "");
    
                            document.getElementById("<%= eventdata.ClientID %>").value = data;
    
                        }
    
                        function savePhoto() {
                            //                        var data = photo.toDataURL("image/png");
    
                            //                        data = data.replace("image/png", "image/octet-stream");
    
                            //                        document.getElementById("<%= eventdata.ClientID %>").value = data;
                            //                        document.location.href = data;
    
                            SendBack();
                        }
    
                        return {
                            init: function () {
    
                                changeStatus('Please accept the permissions dialog.', true);
    
                                video.width = 320;
                                video.height = 240;
    
                                document.body.appendChild(video);
                                document.body.appendChild(photo);
    
                                navigator.getUserMedia || (navigator.getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia);
    
                                play();
                                setupPhotoBooth();
    
                            } ()
    
                        }
    
    
                    })();
    
                function SendBack() {
                    var btn = document.getElementById("<%= btnSavePicture.ClientID %>");
                    btn.click();
                }
    
        </script>
    
        </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to create a fairly large-scale ASP.NET MVC project and I want to
I have an existing complex website built using ASP.NET MVC, including a database backend,
I am looking for different techniques/tools you use to deploy an ASP.NET web application
I have an ASP.Net website which uses a MySQL database for the back end.
We have a requirements to create a Website (ASP.NET v4.0) which displays a Graph.
I am looking for advice on how the save long post contents in asp.net.
I'm looking at writing a basic login page for an ASP.NET website, and all
I'm using asp.net/C# and I'm looking to create unique(?) uris for a small CMS
I am looking to create a multi level drop down menu in asp.net using
I want to have ASP.NET MVC website that would have some frontend for looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.