This VB example uses the FrameAcquired event to display a live video in a PictureBox:
Private SubActiveGige1_FrameAcquired(ByVal Lines As Integer) Picture1.Picture=ActiveGige1.GetPicture
End Sub
This VB.NET example shows how to display a live video in a PictureBox:
Private Sub AxActiveGige1_FrameAcquired(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxActiveGige1.FrameAcquired
If Not (PictureBox1.Image Is Nothing) Then PictureBox1.Image.Dispose()
pictureBox1.Image = Bitmap.FromHbitmap((System.IntPtr)AxActiveGige1.GetPicture().Handle); End Sub
This C# statement shows how to display an image in a PictureBox:
pictureBox1.Image = Bitmap.FromHbitmap((System.IntPtr)axActiveGige1.GetPicture().Handle);
Remarks
The GetPicture method provides the most convenient graphic interface to ActiveGige internal image and allows you to display the last acquired frame in popular graphic controls such as PictureBox. Note that a Picture object contains only 8-bit pixel values, even if the current video mode is a 16- or 48-bit one. To access the actual pixel data, use the GetImageData or GetPointer methods.
In .NET programming environment calling GetPicture inside the FrameAcquiredX event handler may not work. Use the FrameAcquired event instead. It is also necessary to apply the Dispose() method to the PictureBox Image property before each subsequent call to GetPicture in order to prevent the memory leak.