Support Support Home » APIs » XiAPINET


xiAPI.NET stands for XIMEA Application Programming Interface for Dot Net - Microsoft Visual C#
It is a new common interface for all XIMEA cameras and represents a simplified version of generic xiAPI.


API a is the software interface between the camera, operating system driver and application.
xiAPI.NET run-time is based on xiCam class implemented in xiAPI.NET.dll calling the xiapi32.dll on 32bit Windows operating systems and xiAPI.NETX64.dll calling the xiapi64.dll on 64bit Windows operating systems.


To add xiAPI.NET support:
  • install XIMEA Windows Software Package
  • When choosing components make sure: API and Examples are checked.
  • Use one of the available versions of the .NET SDK for your application, supported versions are:
    • Microsoft .NET Framework 4.7.2
    • .NET Core 2.2
    • .NET Core 3.1
  • We recommend to use Microsoft Visual Studio 2013 or a later version for application development.


.NET Sample code - See this section with various .NET examples.
After installation of the XIMEA Windows Software Package - the sample project is installed in the directory XIMEA/Examples/xiAPI.NET.

Here follows a sample code that captures ten images from the camera and saves them as .bmp files.
Exposure time is set 2 ms and gain is set to 5 dB.

// Sample for XIMEA API.NET 

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Drawing;
using xiApi.NET;
namespace xiApi.NET_example
class Program
  static void Main(string[] args)
    xiCam myCam = new xiCam();

      // Initialize first camera

      // Set device exposure to 2 milliseconds
      int exposure_us = 2000;
      myCam.SetParam(PRM.EXPOSURE, exposure_us);

      // Set device gain to 5 decibels
      float gain_db = 5;
      myCam.SetParam(PRM.GAIN, gain_db);

      // Set image output format to monochrome 8 bit

      //Start acquisition

      // Capture images
      Bitmap myImage;
      int timeout = 1000;
      for (int i = 0; i < 10; i++)
        myCam.GetImage(out myImage, timeout );
        string fName = string.Format("image{0}.bmp", i);
      // Stop acquisition

    catch (System.ApplicationException appExc)
      // Show handled error

} // end of Program
} // end of namespace xiApi.NET_example


The core of xiAPI.NET are the following functions, which allow the control of most of the camera functionality.

// open interface
xiCam.OpenDevice(int DevId);

// set parameter
myCam.SetParam(PRM paramName, int paramVal);
myCam.SetParam(PRM paramName, float paramVal);

// get parameter
myCam.GetParam(PRM paramName, out int paramVal);
myCam.GetParam(PRM paramName, out float paramVal);
myCam.GetParam(PRM paramName, out string paramVal);

// get next image from buffer
myCam.GetImage(out myImage);

// close interface

Offline Processing

xiAPI.NET allows to process of already captured and stored images using Offline Processing.
Please read more at xiAPI.NET Offline Processing.


xiAPI.NET Manual
Accessing xiAPI.NET pixel data in .NET Bitmap