I downloaded the original source for VS2003 Framework 1.1 and it appeared to work fine. I wanted to use the 2005 Framework 2.0 copy that Wokawidget posted though. I put it into VS2005 and it compiled without errors. I can start and stop the webcam (the green light goes on and off) however the ImageChanged event never seems to fire even when the cam is on (I put logging in that event in the class to verify it... I also kept tabs on the _Picture variable and it doesn't appear to have anything, like the system isn't returning it).
I know the class is talking to the web cam somewhat because it will turn it on and off, but I can't see to pull the images from it. Thoughts?
Here's the example code from my form that's trying to use the class:
vb Code:
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




Reply With Quote