ライブラリ構成
The IC Imaging Control 4 .NET Class Library is separated into multiple assemblies to limit dependencies and support scenarios where certain other libraries (e.g. System.Windows.Forms or System.Drawing) are not available.
Core Assembly
The core assembly ic4dotnet.dll
contains all the main device-related functionality of IC Imaing Control 4.
Notable classes are:
- DeviceEnum is used to enumerate video capture devices.
- Grabber manages an opened video capture device as well as its data stream.
- SnapSink and QueueSink allow accessing image data through ImageBuffer objects.
- VideoWriter can be used to save images into video files.
Additional Assemblies
The ic4dotnet.System.Windows.Forms
assembly provides Windows Forms integration:
- A display control (WinForms.Display)
- Access to builtin dialogs (WinForms.Dialogs).
The ic4dotnet.System.Drawing
assembly contains extension methods on ImageBuffer for interop with System.Drawing classes:
- CreateBitmapCopy converts an ImageBuffer object into a System.Drawing.Bitmap.
- CreateBitmapWrap creates a System.Drawing.Bitmap using an ImageBuffer's memory. This can be used to avoid unnecessary and possibly expensive copies of image data.
ic4dotnet.System.Windows.Media
contains similar functionality for integration with System.Windows.Media classes:
- CreateBitmapSourceCopy converts an ImageBuffer object into a System.Windows.Media.Imaging.BitmapSource.
- CopyTo copies the contents of an ImageBuffer into an existing System.Windows.Media.Imaging.WritableBitmap. This can be used to avoid unnecessary memory allocations.
The ic4dotnet.OpenCvSharp
assembly allows easy integration of the open-source OpenCvSharp library into IC Imaging Control 4 programs:
- CreateOpenCvCopy creates a new
OpenCvSharp.Mat
object containing a copy of the image data from an ImageBuffer. - CreateOpenCvWrap creates a
OpenCvSharp.Mat
object that uses the memory of an ImageBuffer. The image buffer's memory can then be used directly as source and/or destination for OpenCV operations.