We supply a .NET API for CartoType which provides the same functionality as the C++ API. The .NET SDK, which can be downloaded for evaluation, contains a DLL named CartoTypeWrapper.dll which you can add to your .NET project. For example, to add it to a Windows Forms project, click on Dependencies in the Solution Explorer window, choose Add Project Reference, then click Browse and choose CartoTypeDemo\bin\x64\Release\net8.0-windows\CartoTypeWrapper.dll in your downloaded .NET SDK.

The easiest way to develop a .NET application is using Microsoft Visual Studio (which is not the same as Microsoft Visual Studio Code). The Community Edition is free for small organisations (up to 5 users, fewer than 250 PCs and less than one million USD in annual revenue). You can develop your app using Windows Forms (recommended), WPF, or UWP.

Sample code

The complete source code of a full-featured C# program using CartoType to draw maps and calculate routes is available from CartoType's public Git repository. You can use this code freely in commercial or non-commercial projects under the non-viral MIT license.

Features demonstrated in the C# demo include:

  • Setting up CartoType: loading a map, style sheet and font.
  • Loading additional fonts.
  • Switching style sheets.
  • Inserting pushpins, saving them to a file, and loading them.
  • Creating routes.
  • Changing from vehicle routing to cycle routing or walking.
  • Finding any text in the map.
  • Finding an address using structured input (building number, street and city).
  • Panning, rotating and zooming the map.
  • Loading metadata for the current map.
  • Using asynchronous CartoType functions to find text and create routes, to avoid any delays to the user when interacting with the app.

.NET languages

You can use C# to develop your .NET app, or any other .NET language. The most popular other language is Visual Basic (VB.NET), which is used by some CartoType clients.

Find out more

If you'd like to find out more about using CartoType on .NET, in C# or any other language, please contact us.