So would it be possible to grab a picture say every second and display it ?
I don't really need realtime video for the application I have in mind but if I could get realtime video it would be a bonus. The other criteria I have is that I must be able to draw lines onto the control as well.
The idea behind the application is to allow accurate tracking of a telescope during long exposure photography, so I need to be able to draw cross hairs on a guide star to track.
I've done the cross hair bit, just need to grab the images now, any ideas on how to start this would be greatly appreciated.
VB Code:
Public Class CrossHairs
'members
Public xpos As Integer
Public ypos As Integer
Private Sub DrawCrossHairs(ByVal xpos As Integer, ByVal ypos As Integer)
Me.Refresh()
'create the graphics object
Dim grfx As Graphics = PictureBox1.CreateGraphics
'draw the horizontal line
grfx.DrawLine(Pens.Black, 0, ypos, PictureBox1.Width, ypos)
'draw the vertical line
grfx.DrawLine(Pens.Black, xpos, 0, xpos, PictureBox1.Height)
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
'get the x and y co-ords of the cursor
xpos = e.X
ypos = e.Y
DrawCrossHairs(xpos, ypos)
End Sub
End Class