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 7568799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:00:50+00:00 2026-05-30T15:00:50+00:00

has anyone gotten this http://www.xarg.org/project/jquery-webcam-plugin/ , to work with aps.net mvc 3? I can’t

  • 0

has anyone gotten this http://www.xarg.org/project/jquery-webcam-plugin/, to work with aps.net mvc 3? I can’t seem to decode the image, using the WebImage class or BitmapImage.

I’ve tired to do this with Silverlight, but I’m really unsure on how to upload the image. I do not need to save the image, I just want to process it, what im really looking to do is read a bar-code via web app.

I just can’t seem to find a good guide to uploading an image from Silverlight or flash to my MVC app.

Thanks in advance.

  • 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-05-30T15:00:51+00:00Added an answer on May 30, 2026 at 3:00 pm

    The documentation contains many examples. All that’s needed is to read and try out.

    So here’s how your Index.cshtml view might look like using the browser’s HTML5 canvas element to encode the raw image data coming from the webcam into a PNG image that will be sent to the server using an AJAX request:

    <script src="@Url.Content("~/Scripts/jquery.webcam.js")" type="text/javascript"></script>
    
    <div id="webcam"></div>
    <a href="#" id="upload">Capture image and send for processing</a>
    
    <script type="text/javascript">
        var pos = 0, ctx = null, saveCB, image = [];
        var canvas = document.createElement('canvas');
        canvas.setAttribute('width', 320);
        canvas.setAttribute('height', 240);
        ctx = canvas.getContext('2d');
        image = ctx.getImageData(0, 0, 320, 240);
    
        var saveCB = function (data) {
            var col = data.split(';');
            var img = image;
            for (var i = 0; i < 320; i++) {
                var tmp = parseInt(col[i]);
                img.data[pos + 0] = (tmp >> 16) & 0xff;
                img.data[pos + 1] = (tmp >> 8) & 0xff;
                img.data[pos + 2] = tmp & 0xff;
                img.data[pos + 3] = 0xff;
                pos += 4;
            }
    
            if (pos >= 4 * 320 * 240) {
                ctx.putImageData(img, 0, 0);
                $.post('@Url.Action("Upload")', { type: 'data', image: canvas.toDataURL("image/png") }, function (result) {
                    if (result.success) {
                        alert('The image was successfully sent to the server for processing');
                    }
                });
                pos = 0;
            }
        };
    
        $('#webcam').webcam({
            width: 320,
            height: 240,
            mode: 'callback',
            swffile: '@Url.Content("~/scripts/jscam_canvas_only.swf")',
            onSave: saveCB,
            onCapture: function () {
                webcam.save();
            }
        });
    
        $('#upload').click(function () {
            webcam.capture();
            return false;
        });
    </script>
    

    and your Home controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult Upload(string image)
        {
            image = image.Substring("data:image/png;base64,".Length);
            var buffer = Convert.FromBase64String(image);
            // TODO: I am saving the image on the hard disk but
            // you could do whatever processing you want with it
            System.IO.File.WriteAllBytes(Server.MapPath("~/app_data/capture.png"), buffer);
            return Json(new { success = true });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone gotten the glassfish v3 adapter to work with Eclipse without restarting every
Has anyone migrated a VB6 project to .Net with Visual Studio 2010? I have
Has anyone successfully gotten swfaddress to work with IE8 and above? It seems that
Has anyone ever gotten this error or know what it relates to? I got
Has anyone gotten Multicast to work on Android 2.2, specifically JmDNS for Bonjour service
Has anyone gotten the IFilter sample from Microsoft to work on 64bit Windows 7?
Has anyone gotten the Open Source QR Code Library to work with ColdFusion? I
Has ANYONE gotten a web service call to work with SharePoint to operate with
has anyone gotten these ms-access errors? what do they mean? im connecting access with
Has anyone else had this issue and found a working solution? I've enabled the

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.