VideoCap Pro SDK ActiveX

VideoCap Pro SDK ActiveX

Platform : Windows 10, Windows 8, Vista, Windows 7, XP

For Windows Developers who need to view IP Camera, add video capture with overlay text, image, chroma key effect, face detection, motion detection with C++ , C#, VB.NET , VB, Delphi, Vfp, Ms Access, Labview.

Popular Solution Go   Back

VB.NET - How to Capturing an Image From a Still Image Pin

Step 1: To install the VideoCap Pro ActiveX Control, begin by launching the setup file (http://www.viscomsoft.com/demo/videocapprosetup.exe). Select the desired installation folder for the VideoCap Pro ActiveX and continue with the installation on your development computer.

Step 2: Create New Visual Basic Project, select Windows Application. 

Step 3: The next step is to install VideoCap Pro ActiveX in ToolBox. Select Toolbox, select Components item, right click mouse button, select Choose Items...

Step 4: Select COM Components tab, select VideoCap Pro Control , click OK.

Step 5: Now you will see the VideoCap Pro ActiveX's icon on toolbox, drag it to form.

Step 6: Add two combo box, two buttons, two label and savefiledialog on form. Like the following picture.



Step 7. add the following code in Form load event
 

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Dim i As Integer

        For i = 0 To AxVideoCap1.GetDeviceCount - 1

            cbovideodevice.Items.Add(AxVideoCap1.GetDeviceName(i))

        Next

        If cbovideodevice.Items.Count > 0 Then

            cbovideodevice.SelectedIndex = 0

        End If

End Sub

Step 8. add the following code in Video Device Combo Box's SelectedIndexChanged event.

 Private Sub cbovideodevice_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cbovideodevice.SelectedIndexChanged

        AxVideoCap1.RefreshVideoDevice(cbovideodevice.SelectedIndex)

        AddStillPinVideoFormat()

 

  End Sub

Step 9 . Add AddStillPinVideoFormat() function

 Private Sub AddStillPinVideoFormat()

        Dim i As Integer

        Dim strStillPinName As String

        cbostillpinformat.Items.Clear()

        For i = 0 To AxVideoCap1.StillPinVideoFormats.Count - 1

            strStillPinName = AxVideoCap1.StillPinVideoFormats.FindVideoFormatName(i)

            cbostillpinformat.Items.Add(strStillPinName)

        Next

        If cbostillpinformat.Items.Count > 0 Then

            cbostillpinformat.SelectedIndex = 0

        End If

End Sub

Step 10 . Add the following code in Preview button click event

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        AxVideoCap1.Device = cbovideodevice.SelectedIndex

        AxVideoCap1.StillPinVideoFormat = cbostillpinformat.SelectedIndex

        AxVideoCap1.Start()

End Sub

Step 11. Add the following code in Snapshot button click event

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click

        SaveFileDialog1.Filter = "JPEG file (*.jpg)|*.jpg||"

        SaveFileDialog1.DefaultExt = "jpg"

        SaveFileDialog1.ShowDialog()

        AxVideoCap1.SnapShotJPEG(SaveFileDialog1.FileName, 99) 

End Sub

Step 12. Now run the project, select the video device,  if your cameras can produce a still image separate from the capture stream, you can select Still Pin Format. Otherwise your cameras does not support Still Image Pin. Still image Pin can produce more higher quality than the images produced by the capture stream.
After you selected Still Pin Format , make sure you click Preview button first, then click the Snapshot button.


 Download the source code of the Capturing an Image From a Still Image Pin Sample