Compiling a C# example program to get images of your industrial camera in Visual Studio
Microsoft developed Microsoft Visual Studio, an integrated development environment (IDE). It is used for the development of computer programs among different software’s. This article explains how to use the C# example program to view images of your industrial camera in Visual Studio.
Step 1: Download Visual Studio Community 2019 free.
To start, you need to download Visual Studio Community 2019 from Microsoft’s official website or use this direct link: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16.
This IDE is free of charge and supports 36 different programming languages, including C#.
Please save this file in a safe folder for your convenience.
Once completed, double click on the .exe file.
Additional components may be downloaded:
Once the download is complete, click the “install” button in the bottom right.
The program asks to log in after installation. You can skip this and click on “not now maybe later”.
When done the program will start.
Step 2: Open the example program GXSINGLECAM_VS2015.CSPROJ project
Once you have installed Visual Studio Community 2019, you need to open the GXSINGLECAM_VS2015.CSPROJ project. You can find this example program in C:\Program Files\Daheng Imaging\GalaxySDK\Samples\CSharp SDK\x64\src\GxSingleCam\.
Make sure you have installed our windows SDK (number 3 in the screenshot below of our download area)
Please open the example program. There will be a warning regarding restarting the app. You may click yes.
TIP: To avoid this in the future always run the app Visual studio as an administrator (right click on the app icon or desktop icon and choose “run as administrator”)
Download and install further components if asked:
Step 3: Set the properties correctly
After opening the project, set the properties of each highlighted file as “build action >> content.” Make sure you are working under your project GxSingleCam_VS2015’s tree.
Step 4: Build application
Click on the “Build” button in the taskbar and select “Build Solution.”
Check the “Output” view at the bottom of the page for any errors. If there are no errors, your program has been successfully compiled and checked.
Step 5: Execute example program
Press the “Start” button to execute the newly compiled program. You can now open a camera device and acquire images using this C# example program in Visual Studio.
In conclusion, follow these steps to compile and run a C# example program to acquire images in Visual Studio. Ensure that you have downloaded and installed Visual Studio Community 2019, opened the GXSINGLECAM_VS2015.CSPROJ project, set the properties correctly, built the application, and executed the example program.
Contact us if you need any support.