ImageDev C#
This section details how to start with ImageDev .NET.
The following information has been mostly tested on Windows with Visual 2017 on .NET Framework and .NET
Core projects.
ImageDev C# can be installed with NuGet local feeds, set up from the package archives available in the ImageDev download page.
First, the Visual Studio package manager must be set in PackageReference mode:
To create a new ImageDev project from an available package archive, you need to:
You can now run this code and compare the resulting images with those shown in the HelloImageDev tutorial.
ImageDev C# can be installed with NuGet local feeds, set up from the package archives available in the ImageDev download page.
Prerequisites
Supported platforms
ImageDev requires a .NET platform compatible with .NET Standard 2.0 or 2.1, which means:- On Windows:
- .NET Framework 4.6.1 with Visual Studio 2017 or 2019
- .NET Core 2.1 or 2.2 with Visual Studio 2017
- .NET Core 2.1, 2.2 or 3.0 with Visual Studio 2019
- On Linux (Ubuntu 18.04):
- .NET Core 2.1, 2.2 or 3.0
NuGet package manager
ImageDev is distributed as NuGet packages. These packages are available in downloadable archives.First, the Visual Studio package manager must be set in PackageReference mode:
- In Visual Studio, open the Tools > Options > NuGet Package Manager > General panel.
- Set the Default package management format menu to PackageReference.
Creating local NuGet feeds
This section describes how to configure a NuGet private server for deploying ImageDev packages.To create a new ImageDev project from an available package archive, you need to:
- Download the nuget.exe utility available on the nuget.org download page . It is recommended to use the latest version.
- Move this file to a directory whose path is known by the system (for instance, "C:/Windows/System32").
- Download the ImageDevNet and ImageDevExamplesNet package archives.
- Unzip these archives in a folder.
- Execute the following command lines:
nuget init path_to_unzipped_ImageDev/nuget path_to_local_server nuget init path_to_unzipped_ImageDevExamples/nuget path_to_local_serverWhere:
- path_to_unzipped_ImageDev is the path to the unzipped ImageDevNet folder
- path_to_unzipped_ImageDevExamples is the path to the unzipped ImageDevExamplesNet folder
- path_to_local_server is the path where to deploy the private feeds
Configuration of the NuGet server
In Visual Studio, NuGet must be configured as follows:- Run Visual Studio.
- In the "Tools" menu, select "Options...".
- In the left list, unfold "NuGet Package Manager".
- Select "General".
- Check "Allow NuGet to download missing packages".
- Check "Automatically check for missing packages during build in Visual Studio".
- Still in "NuGet Package Manager", select "Package Sources".
- Click on the "+" green button; a new line is added.
- In the Name field, enter "ImageDevNuGetFeeds"
- Click on the "Update" button.
- Click on the "OK" button.
Project configuration
For a Visual Studio project, the ImageDev prepacks are managed by NuGet:- In the solution explorer, right click on the project to be linked with ImageDev.
- Select the "Manage NuGet packages..." item.
- In the "Package source" list select the ImageDevNuGetFeeds source.
- In the "Browse" tab search ImageDev.
- Select "ImageDev" and press install.
- To use IOFormat, for loading and saving image files, install also "IOFormat" NuGet package.
- To run example, install also "ImageDev.Data" NuGet package.
- A .NET framework project must explicitely be set to 64-bit target platform.
- In the "Project" menu, select "Properties...".
- Select the "Build" panel.
- In the "General" section, uncheck the "Prefer 32-bit" box.
Hello ImageDev C#
To use ImageDev, you first need to open or create a .NET Framework or .NET Core project and add the using directives for ImageDev, IOLink and IOFormat.using ImageDev; using IOLink; using IOFormat;You are now ready to write your first ImageDev code, for instance by copying and pasting the content of the Main function of the C# example available at the end of the HelloImageDev tutorial page.
You can now run this code and compare the resulting images with those shown in the HelloImageDev tutorial.