Build C# Samples using Visual Studio

Introduction

This tutorial shows how to build the C# Samples project with reference to Zivid C++ API using Visual Studio in Windows.

Requirements

Instructions

Step by step instructions is provided with screenshots below.

Clone C# samples

To clone our GitHub Zivid C# Samples repository, launch the Command Prompt by pressing Win + R keys on the keyboard, then type cmd and press Enter.

Windows Run command

Navigate to a location where you want to clone the repository (Git has to be installed):

cd C:\Users\Public\Downloads

Then run the following command:

git clone https://github.com/zivid/zivid-csharp-samples

Install extra dependencies

Install required dependencies based on the sample programs you want to run; see the table below.

Sample program

YamlDotNet

Math.Net Numerics

UtilizeHandEyeCalibration

Yes

Yes

Both of these libraries can be installed using the NuGet package manager within Visual Studio. If you have allowed NuGet to download missing packages, these packages will be installed automatically.

Alternatively, you can use the command-line interface to install them by typing the following in the Package Manager Console:

  • YamlDotNet: Install-Package YamlDotNet

  • Math.Net Numerics: Install-Package MathNet.Numerics

Build the solution

Open ZividNETSamples.sln in Visual Studio.

Change the build configuration from Debug to Release.

Build the solution by pressing Ctrl + Shift + B.

C# samples Visual Studio solution

Run the sample program

Navigate to the Release folder in File Explorer.

C# samples Release folder path

Run a sample program, e.g. CaptureVis3D.exe

Output point cloud from CaptureVis3D