Please enable JavaScript to view this site.

uEye .NET Manual 4.97

The Overlay class provides methods for controlling the overlay data of the camera's live image without flicker. The graphics card functions of the OpenGL library are supported under Windows and Linux. The Direct3D library are supported only under Windows.

hint_info

Note on system requirements

To use the Direct3D functionality, the appropriate version of the Microsoft DirectX Runtime has to be installed in your PC.

When you are using high-resolution cameras, the maximum texture size supported by the graphics card should be at least 4096 x 4096 pixels. You can check the maximum texture size by GetMaxSize().

The Direct3D mode automatically uses the Windows Desktop color depth setting for the display.

Please also read the notes on graphics cards which are provided in the "System requirements" chapter in the uEye manual.

hint_info

Note on displaying monochrome or raw data formats

To display monchrome or Bayer raw data in Direct3D, please set the appropriate display mode constants using Set().

Methods

Method

Description

Clear

Deletes the data of the overlay area by filling it with black color.

DisableSemiTransparent

Disables the semi-transparent display of the overlay area.

EnableSemiTransparent

Enables a semi-transparent display of the overlay area.

GetDC

Returns the device context (DC) handle to the overlay area of the graphics card.

GetGraphics

Returns the overlay graphics.

GetKeyColor

Returns the RGB values of the current key color (default: black).

GetMaxSize

Returns the width and height of the maximum overlay area supported by the graphics card.

GetSize

Returns the size of the overlay area.

Hide

Disables overlay display.

LoadImage

Loads a bitmap image (*.BMP file) into the overlay area.

ReleaseDC

Releases the device context (DC) handle and updates the overlay data.

SetGraphics

Releases the device context (DC) handle.

SetKeyColor

Defines the RGB values of the key color.

SetPosition

Defines the position of the overlay area.

SetSemiTransparent

Enables/disabled the semi-transparent display of the overlay area.

SetSize

Defines the size of the overlay area (default: current camera image size).

SetVisible

Sets the overlay to visible.

Show

Enables overlay display on top of the current camera image.

Example 1

// DC-Handle
// Get DC handle for Overlay
int hDC;
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
overlay.GetDC(out hDC);
 
// Release DC handle
overlay..ReleaseDC();

Example 2

// Overlay size and position
 
// Query maximum size of overlay area
uEye.Types.Size<uint> size;
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
overlay.GetMaxSize(out size);
 
// Set size of overlay area
uEye.Types.Size<uint> newSize = new uEye.Types.Size<uint>();
newSize.Width = 100;
newSize.Height = 120;
 
overlay.SetSize(newSize);
 
// Set position of overlay area
hCam.DirectRenderer.Overlay.SetPosition(20, 0);

Example 3

// Key color
 
// Get current key color
System.Drawing.Color color;
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
overlay.GetKeyColor(out color);
 
// Set new key color
overlay.SetKeyColor(System.Drawing.Color.Red);

Example 4

// Example display
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
 
// Show overlay
overlay.Show();
 
// Hide overlay
overlay.Hide();

Example 5

// Example transparency
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
 
// Enable semi-transparent overlay
overlay.EnableSemiTransparent();
 
// Disable semi-transparent overlay
overlay.DisableSemiTransparent();

Example 6

// Example overlay with BMP
uEye.DirectRendererOverlay overlay = new uEye.DirectRendererOverlay(hCam);
 
// Load overlay from BMP file
overlay.LoadImage("c:\test.bmp");
 
// Delete overlay area
overlay.Clear();