Last updated: 29 November 2024

How to compile a C# example program to acquire images in Visual Studio

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs among many other software’s.

The basic edition of Visual Studio, the Community edition, is available free of charge.

How to compile a C# example program to acquire images in Visual Studio

Visual Studio supports 36 different programming languages and allows the code editor and debugger to support (to varying degrees) nearly any programming language. Built-in languages include C, C++, C++/CLI, Visual Basic .NET, C#. Support for other languages such as Python is available via plug-ins.

Step 1: download visual studio community 2019 free.

Go to https://visualstudio.microsoft.com/
Choose to download the Visual community 2019 free version, or use  the direct link: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16



You will be asked to save the file, please place it in a safe folder.



When done please Double click on the downloaded .exe file



Additional components may be downloaded:



When download is finished, Click on the bottom right on the “install button”



When installation is finished, the program asks to log in, you can skip and click on “not now maybe later”



When done the program will start.

STEP 2: Now VS2019 is installed, open project “GxSingleCam_VS2015.csproj”

Make sure you have installed our windows SDK (number 3 in the screenshot below of our download area)



The example programs is located in: C:\Program Files\Daheng Imaging\GalaxySDK\Samples\CSharp SDK\x64\src\GxSingleCam\

Please open the example program. You will get a warning to restart the app using a different account, you can indeed say yes.
TIP: To avoid this in the future always run the app Visual studio as administrator (right lick on the app icon or desktop icon, chose run as administrator)



Download and install further components if asked:



Step 3:  Set the properties correct

Set the properties of each highlighted files (1) as “build action >> content” (2).
(Make sure you are working under your project GxSingleCam_VS2015 ‘s tree)




STEP 4: Build application

In the task bar click on Build, Build solution:



Please check at the bottom of the page in the view “Output” that there are no errors. Now your program has been compiled and checked.

 

STEP 5: Execute example program

Press START button. The newly compiled program is executed and you can open a camera device and acquire images.




Contact us below, if you have still questions.