Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i Am usning A Class
this code

C#
 Imports System
Imports System.IO
Imports System.Text
Imports WebCam_Capture
Imports System.Collections.Generic

Namespace CSharpWebCam

    'Design by Dharma Iyer
    Class WebCam

        Private webcam As WebCamCapture

        Private _FrameImage As System.Windows.Forms.PictureBox

        Private FrameNumber As Integer = 30

        Public Overloads Sub InitializeWebCam(ByRef ImageControl As 

System.Windows.Forms.PictureBox)
            webcam = New WebCamCapture
            webcam.TimeToCapture_milliseconds = FrameNumber
            AddHandler webcam.ImageCaptured, AddressOf 

Me.webcam_ImageCaptured
            _FrameImage = ImageControl
        End Sub

        Private Sub webcam_ImageCaptured(ByVal source As Object, ByVal 

e As WebcamEventArgs)
            _FrameImage.Image = e.WebCamImage
        End Sub

        Public Sub Start()
            webcam.TimeToCapture_milliseconds = FrameNumber
            webcam.Start(0)
        End Sub

        Public Sub Stop()
            webcam.Stop()
        End Sub

        Public Sub Continue()
            ' change the capture time frame
            webcam.TimeToCapture_milliseconds = FrameNumber
            ' resume the video capture from the stop
            webcam.Start(Me.webcam.FrameNumber)
        End Sub

        Public Sub ResolutionSetting()
            webcam.Config()
        End Sub

        Public Sub AdvanceSetting()
            webcam.Config2()
        End Sub

        Friend Overloads Sub InitializeWebCam(ByVal imgCam As 

System.Windows.Forms.PictureBox)
            Throw New NotImplementedException
        End Sub
    End Class
End Namespace
----------------------------------------------------------
but there is error in this code
Error	1
Public Overloads Sub InitializeWebCam(ByRef ImageControl As 

System.Windows.Forms.PictureBox)
            webcam = New WebCamCapture
            webcam.TimeToCapture_milliseconds = FrameNumber
            AddHandler webcam.ImageCaptured, AddressOf 

Me.webcam_ImageCaptured
            _FrameImage = ImageControl
        End Sub
'Public Overloads Sub InitializeWebCam(ByRef ImageControl As 

System.Windows.Forms.PictureBox)' and 'Friend Overloads Sub 

InitializeWebCam(imgCam As System.Windows.Forms.PictureBox)' cannot 

overload each other because they differ only by parameters declared 

'ByRef' or 'ByVal'.	


------------------------------------------------------
and there is another error
Public Sub Continue()
            ' change the capture time frame
            webcam.TimeToCapture_milliseconds = FrameNumber
            ' resume the video capture from the stop
            webcam.Start(Me.webcam.FrameNumber)
        End Sub


Error	2	Keyword is not valid as an identifier.	C:\Documents 

and Settings\MUHAMMAD 

IRFAN\Desktop\ClassLibrary1\ClassLibrary1\Class1.vb	34	20	

ClassLibrary1
Posted
Updated 3-Oct-13 8:21am
v2
Comments
Sergey Alexandrovich Kryukov 3-Oct-13 14:22pm    
Not clear. I have no idea what is WebCam_Capture you are using. Any references? What "errors", exactly? Not enough information. And there are other camera capture articles on the Web, please see CodeProject article, in particular.
—SA
Sampath Lokuge 3-Oct-13 14:30pm    
Check this may be helped to you.http://go4answers.webhost4life.com/Example/image-capture-webcam-aspnet-csharp-91498.aspx

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