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.
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. |
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 |
---|---|
Disables real-time scaling. |
|
Enables real-time scaling of the image to the size of the display window. The overlay is not scaled. |
|
Enables real-time scaling of the image to the size of the display window. The overlay is scaled together with the camera image. |
|
Returns the color format setting for the steal function. |
|
Returns the supported display modes. |
|
Returns the minimum and maximum row position for SetUserSync(). |
|
Enables/disables real-time scaling of the image to the size of the display window. |
|
Defines the color format for the steal function. |
|
Enables synchronization of the image display with a monitor pixel row specified by the user. |
|
Sets a new window handle for image output in Direct3D. |
|
Copies the next image to the active user memory (steal function). |
|
Redraws the current image and overlay. |
|
Enables synchronization of the image display with the monitor's image rendering. |
|
Disables image display synchronization. |
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);