Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
i want to capture the image but i am getting the error says:-The type or namespace name 'WebcamEventArgs' could not be found(are you missing an assembly reference?)
The type or namespace name 'WebCam_Capture' could not be found(are you missing an assembly reference?)
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Runtime.InteropServices;
using webcam_capture;
 
namespace CSharpWebCam
{
    class WebCam
    {
       
        private  WebCamCapture webcam;
        private System.Windows.Forms.PictureBox _FrameImage;
        private int FrameNumber = 30;
        public void InitializeWebCam(ref System.Windows.Forms.PictureBox ImageControl)
        {
            webcam = new WebCamCapture();
            webcam.FrameNumber = ((ulong)(0ul));
            webcam.TimeToCapture_milliseconds = FrameNumber;
            webcam.ImageCaptured += new WebCamCapture.WebCamEventHandler(webcam_ImageCaptured);
            _FrameImage = ImageControl;
        }
 
        void webcam_ImageCaptured(object source,WebCam_Capture.WebcamEventArgs e)
        {
            _FrameImage.Image = e.WebCamImage;
        }
 
        public void Start()
        {
            webcam.TimeToCapture_milliseconds = FrameNumber;
            webcam.Start(0);
        }
 
        public void Stop()
        {
            webcam.Stop();
        }
 
        public void Continue()
        {
            // change the capture time frame
            webcam.TimeToCapture_milliseconds = FrameNumber;
 
            // resume the video capture from the stop
            webcam.Start(this.webcam.FrameNumber);
        }
 
        public void ResolutionSetting()
        {
            webcam.Config();
        }
 
        public void AdvanceSetting()
        {
            webcam.Config2();
        }
 

        internal void InitializeWebCam(System.Windows.Forms.PictureBox imgCam)
        {
            throw new NotImplementedException();
        }
    }
}
 
[edit]Code block added - OriginalGriff[/edit]
Posted 28-Jan-13 21:32pm
Edited 28-Jan-13 21:42pm
v2
Comments
Sergey Alexandrovich Kryukov at 29-Jan-13 3:43am
   
Why are you re-posting? I warned you 3 times.
I'm serious: it can lead to banning of your account.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Validate if you correctly referenced assembly in your solution file.
Most likely it resides in some dll file like WebCam_Capture.dll
 

Here are the steps:
http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Assuming you have added the reference to the web cameras DLL file...
Take out the line:
using webcam_capture;
 
Then compile your program - you will get errors.
GO to the first error and put the cursor in the first word that is underlined in red. A small blue box will appear at the beginning of the word. Hover the mouse over the box, and a dropdown will appear. Open the drop down, and it will have possible solutions to the problem. The first one should be "using ..." select it and it will add the using statement for you. Repeat this until your references are correct.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
 
you need to go to
https://sites.google.com/site/webcamlibrarydotnet/winfrom-and-csharp-sample-code-and-download[^]
 
and download DLLforAddReference.zip, extract the WebCam_Capture.dll to your project directory
and add this dll to your References.
 
And change using webcam_capture; to using WebCam_Capture;
 
Then it should work.
 
Regards,
 
Thomas.
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid