The simplest way for getting started is using Visual Studio. Make sure you have the .Net-Desktop Development package installed. Also a current version of CVB needs to be installed (download for Windows 32 or Windows 64). Starting with 13.02.000 CVB .Net is included in the standard installers for Windows. If you use an older 13.x version you still can download it separately (see here) .
First create a Console, Windows Forms or WPF App as you like (or take an existing one). In this post we just add the necessary assemblies. Later on we see some code.
But before we start let’s take care of a gotcha when using 64 bit: Default project setting is AnyCPU which is exactly what we need. Uncheck the Prefer 32-bit check box in the build settings for Debug and Release:
If this stays checked the process will be 32-bit. Then some things are not working as expected or you immediatly get a
BadImageFormatException as we install either 32-bit or 64-bit .
I recommend reading this from top to bottom, but here are the main topics for the impatient:
- Acquire Images from a Stream (AVI Demo)
- Acquire Images from a Camera
- Windows Forms App
- WPF App
- Stream Statistics
Before you can do anything with in .Net, you need to add the references to our Stemmer.Cvb assemblies:
In the opened dialog switch to Browse and click on the Browse… button:
in your address list to jump to the library directory for .Net. Ignore the iXXX.dll group of DLLs (e.g. iCVCImg.dll) – these are the C-style P/Invoke assemblies. We are interested in the Stemmer.Cvb.* assemblies.
This is the core assembly containing basic
Device handling including acquisition via
Streams and configuration (like GenICam GenApi or IDeviceControl).
This combines now the functionality of CVCError.dll, iCVCImg.dll, iCVCDriver.dll, iCVCUtilities.dll, and iCVGenApi.dll.
GenApiGrid for Windows Forms apps. If you reference this one Stemmer.Cvb.Extensions.dll and Stemmer.Cvb.Aux.dll are needed.
This combines the functionality of the CVDisplay ActiveX and CVGenApi ActiveX controls.
GenApiGrid for WPF apps. You also need Stemmer.Cvb.Extensions.dll if you reference this assembly.
In principle this also combines the functionality of the CVDisplay ActiveX and CVGenApi ActiveX controls. The display is a pure WPF implementation, though.
This is needed by the
Stemmer.Cvb.Forms.Controls.Display for native interop handling (mostly overlay related).
In here we put extension methods especially for the
System.Drawing namespace to be able to support .Net Core.
All Foundation functions and Foundation tools are bundled in here covering for example correlation, filtering, non-linear calibration, blob, optical flow and more.
Combined in here is the functionality of the iCVCFoundation.dll, iBayerToRGB.dll, iCVCEdge.dll, and iLightMeter.dll.
(Sample Image List (SIL) handling)