Please enable JavaScript to view this site.

uEye .NET Manual 4.97

The DirectRenderer class provides a set of advanced rendering functions and allows inserting overlay data into 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

DisableScaling

Disables real-time scaling.

EnableImageScaling

Enables real-time scaling of the image to the size of the display window. The overlay is not scaled.

EnableScaling

Enables real-time scaling of the image to the size of the display window. The overlay is scaled together with the camera image.

GetStealFormat

Returns the color format setting for the steal function.

GetSupported

Returns the supported display modes.

GetUserSyncPosRange

Returns the minimum and maximum row position for SetUserSync().

SetScaling

Enables/disables real-time scaling of the image to the size of the display window.

SetStealFormat

Defines the color format for the steal function.

SetUserSync

Enables synchronization of the image display with a monitor pixel row specified by the user.

SetWindowHandle

Sets a new window handle for image output in Direct3D.

StealNextFrame

Copies the next image to the active user memory (steal function).

Update

Redraws the current image and overlay.

VsyncAuto

Enables synchronization of the image display with the monitor's image rendering.

VsyncOff

Disables image display synchronization.

hint_info

Functions for working with overlays can be found in the separate DirectRendererOverlay class in the uEye .NET Framework Library.

Example 1

// Supported function
uEye.Defines.DisplayMode supported;
nRet = hCam.DirectRenderer.GetSupported(out supported);
 
uEye.Defines.DisplayMode mode = supported & uEye.Defines.DisplayMode.Direct3D;
if (mode != 0)
{
// Direct3D is supported
}
 
mode = supported & uEye.Defines.DisplayMode.OpenGL;
if (mode != 0)
{
// OpenGL is supported
}

Example 2

// Example scaling
// Enable scaling
hCam.DirectRenderer.EnableScaling();
 
// Disable scaling
hCam.DirectRenderer.DisableScaling();

Example 3

// Example synchronization
// Enable auto-synchronization
hCam.DirectRenderer.VsyncAuto();
 
// User defined synchronization: Query range and set position
uint posMin, posMax;
hCam.DirectRenderer.GetUserSyncPosRange(out posMin, out posMax);
uint SyncPosition = 400;
hCam.DirectRenderer.SetUserSync(SyncPosition);
 
// Disable synchronization
hCam.DirectRenderer.VsyncOff();

Example 4

// Example steal mode
// Get and set color mode for image to be copied
uEye.Defines.ColorMode mode;
hCam.DirectRenderer.GetStealFormat(out mode);
 
uEye.Defines.ColorMode newMode = uEye.Defines.ColorMode.Mono8;
hCam.DirectRenderer.SetStealFormat(newMode);
 
// Copy image with function returning immediately
uEye.Defines.DeviceParameter wait = uEye.Defines.DeviceParameter.DontWait;
hCam.DirectRenderer.StealNextFrame(wait);