Results 1 to 10 of 10

Thread: [RESOLVED] Type define problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    166

    Resolved [RESOLVED] Type define problem

    When I Write the line below, I get an error: Type 'WebCamera' is not defined.

    Private WithEvents _Camera As WebCamera

    What is the problem?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Type define problem

    The problem is that WebCamera is not a variable type, like Integer or String or something along those lines, that VB recognizes. It doesn't know what you mean.

    What do you mean?

    I have no clue what WebCamera, as a type, means either.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    166

    Re: Type define problem

    I found this code on the web. but, I got an error about the WebCamera type.

    do I need a WebCamera control or .ocx? where can I find it?



    Code:
    Class Form1
    
        Private WithEvents _Camera As WebCamera
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            _Camera = New WebCamera
            _Camera.StartFeed()
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            _Camera = New WebCamera
            _Camera.StartFeed()
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    
            If _Camera.Running Then
                _Camera.EndFeed()
            End If
        End Sub
        Private Sub _Camera_ImageChanged() Handles _Camera.ImageChanged
            Me.Text = "Changed at " & Now().ToString
            Dim NewImage As Image = _Camera.CurrentImage
            PictureBox1.Image = NewImage
            NewImage.Dispose(NewImage = Nothing)
        End Sub
    
    End Class

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Type define problem

    I have no idea.

    Where ever you found it should supply the answers to these questions.

    Where did you find it?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    166

    Re: Type define problem

    In this link (#6 thread):

    http://www.vbforums.com/showthread.php?t=564246

    Is it wrong? Do I need to find something else?

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Type define problem

    Hey,

    If I am right, then he is using the Camera Class which Pino made here:

    http://www.vbforums.com/showthread.p...66#post2048466

    And which is referenced in this thread:

    http://www.vbforums.com/showthread.php?p=3488608

    Gary

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Type define problem

    Quote Originally Posted by assafey View Post
    In this link (#6 thread):

    http://www.vbforums.com/showthread.php?t=564246

    Is it wrong? Do I need to find something else?
    It isn't Post #6 that you need, it is what is in Post #5

  8. #8
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Type define problem

    Hi,

    Here's an example how to use a webcam with DirectShow.Net with codes and explanation.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    166

    Re: Type define problem

    It isn't Post #6 that you need, it is what is in Post #5
    Hack I have the same error problem here:

    Code:
    Private myCam As iCam
    Type 'iCam' is not defined



  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Type define problem

    assafey, have you had a look at the sample project that Pino has included in his post? I think that would make things clearer.

    Have you included the iCam class in your project and included any necessary "Imports" to get it to work?

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width