Home > Function descriptions > History back  Previous chapter  Next chapter  Print  

DirectRenderer

uEye ActiveX Manual Version 4.00

DirectRenderer

Syntax

LONG DirectRenderer(LONG nMode, BYTE *pParam, LONG SizeOfParam)

Description

DirectRenderer() 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 Direct3D library are supported under Windows.

Hinweis

Notes on using the function

The second input parameter nMode specifies the effect of the DirectRenderer() call.

The value of the third parameter pParam depends on the mode selected with nMode: For example, when setting the overlay size (nMode = DR_SET_OVERLAY_SIZE), a pointer to an array of two values (x and y) is passed (see code samples). When you load a bitmap image (nMode = DR_LOAD_OVERLAY_FROM_FILE), pParam passes the path to the file (see code samples). The required parameters are illustrated in the sample codes at the end of this section.

Hinweis

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 reading out the D3D_GET_MAX_OVERLAY_SIZE parameter.

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.

Parameters

nMode

 

DR_GET_OVERLAY_DC

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

In Direct3D mode, the DR_GET_OVERLAY_DC mode returns the device context (DC) handle of the overlay area. Using this handle, it is possible to access the overlay using the Windows GDI functionality. Thus, all Windows graphics commands (e.g. Line, Circle, Rectangle, TextOut) are available. To transfer the drawn elements to the overlay, release the DC handle by calling DR_RELEASE_OVERLAY_DC.

DR_RELEASE_OVERLAY_DC

Releases the device context (DC) handle.

Using DR_RELEASE_OVERLAY_DC, you can release the DC handle and update the overlay data.

DR_GET_MAX_OVERLAY_SIZE

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

DR_SET_OVERLAY_SIZE

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

DR_GET_OVERLAY_SIZE

Returns the size of the overlay area.

DR_SET_OVERLAY_POSITION

Defines the position of the overlay area.

DR_GET_OVERLAY_KEY_COLOR

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

DR_SET_OVERLAY_KEY_COLOR

Defines the RGB values of the key color.

The key color specifies where the camera image will be visible in the overlay area. For example: if you fill the complete overlay with the key color, the whole camera image will be visible. If you fill part of the overlay with a different color, the camera image will be covered by the overlay in those places.

The key color has no effect in semi-transparent mode!

DR_SHOW_OVERLAY

Enables overlay display on top of the current camera image.

DR_HIDE_OVERLAY

Disables overlay display.

DR_ENABLE_SCALING

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

DR_ENABLE_IMAGE_SCALING

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

DR_DISABLE_SCALING

Disables real-time scaling.

DR_ENABLE
_SEMI_TRANSPARENT_OVERLAY

Enables a semi-transparent display of the overlay area.

In semi-transparent mode, the values of the camera image and the overlay data are added up for each pixel. Since black has the value 0, the complete camera image will be visible if the overlay is black; if the overlay is white, only the overlay will be visible. With all other colors, the camera image will be visible with the overlay superimposed.

The key color has no effect in semi-transparent mode!

DR_DISABLE
_SEMI_TRANSPARENT_OVERLAY

Disables the semi-transparent display of the overlay area.

DR_SET_VSYNC_AUTO

Enables synchronization of the image display with the monitor's image rendering. The image is displayed upon the monitor's next VSYNC signal.

DR_SET_VSYNC_OFF

Disables image display synchronization. The image is displayed immediately.

DR_SET_USER_SYNC

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

When displaying very large camera images, the auto-VSYNC function might not always optimally synchronize image rendering. In this case, you can eliminate flicker by manually setting a suitable position for synchronization. The position needs to be determined individually, based on the camera type and the graphics card.

DR_GET_USER
_SYNC_POSITION_RANGE

Returns the minimum and maximum row position for DR_SET_USER_SYNC.

DR_LOAD_OVERLAY_FROM_FILE

Loads a bitmap image (*.BMP file) into the overlay area. If the bitmap image is larger than the overlay area, the bitmap image is clipped.

DR_CLEAR_OVERLAY

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

DR_STEAL_NEXT_FRAME

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

Using the pParam parameter, you specify when the function should return:

IS_WAIT: The function waits until the image save is complete.

IS_DONT_WAIT: The function returns immediately.

DR_SET_STEAL_FORMAT

Defines the color format for the Steal function.

For a list of all available color formats, see the function description for SetColorMode(). The default is IS_CM_BGRA8_PACKED (RGB 32).

DR_GET_STEAL_FORMAT

Returns the color format setting for the Steal function.

DR_SET_HWND

Sets a new window handle for image output in Direct3D.

DR_CHECK_COMPATIBILITY

Returns whether the graphics card supports the uEye Direct3D functions.

pParam

BYTE-type pointer to a data object or an array of objects (depending on the mode selected using nMode).

SizeOfParam

Size (in bytes) of the data object or array.

Return values

IS_SUCCESS

Function executed successfully

IS_NO_SUCCESS

General error message

When used with

DR_CHECK_COMPATIBILITY

IS_DR_DEVICE_CAPS_INSUFFICIENT

The graphics hardware does not fully support the uEye Direct3D functions

Related functions

SetColorMode()

ClearDirect3DOverlay()

IsDirectRendererSupported()


Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!

For technical questions please contact you local distributor or use the support form on our website.


© 2012 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com