© 2013 Thorlabs GmbH
4 Programming (SDK)
203
Example synchronization
//------------------------------------
// Synchronization
//------------------------------------
// Enable auto-synchronization
is_DirectRenderer (hCam, DR_SET_VSYNC_AUTO, NULL, NULL);
// User defined synchronization: Query range and set position
UINT UserSync[2];
is_DirectRenderer (hCam, DR_GET_USER_SYNC_POSITION_RANGE,
(void*)UserSync, sizeof (UserSync));
INT Min = UserSync[0];
INT Max = UserSync[1];
INT SyncPosition = 400;
is_DirectRenderer (hCam, DR_SET_USER_SYNC,
void*)&SyncPosition, sizeof (SyncPosition));
// Disable synchronization
is_DirectRenderer (hCam, DR_SET_VSYNC_OFF, NULL, NULL);
Example overlay with BMP
//------------------------------------
// BMP file
//------------------------------------
// Load overlay from BMP file
is_DirectRenderer (hCam, DR_LOAD_OVERLAY_FROM_FILE,
(void*)”c:\test.bmp”, NULL);
//------------------------------------
// Delete overlay
//------------------------------------
// Delete overlay area
is_DirectRenderer (hCam, DR_CLEAR_OVERLAY, NULL, NULL);
Example steal mode
//------------------------------------
// Steal mode
//------------------------------------
// Get and set color mode for image to be copied
INT nColorMode;
is_DirectRenderer (hCam, DR_GET_STEAL_FORMAT,
(void*)&nColorMode, sizeof (nColorMode));
nColorMode = IS_CM_MONO8;
is_DirectRenderer (hCam, DR_SET_STEAL_FORMAT,
void*)&nColorMode, sizeof (nColorMode));
// Copy image with function returning immediately
INT nwait = IS_DONT_WAIT;
is_DirectRenderer(hCam, DR_STEAL_NEXT_FRAME,
(void*)&wait, sizeof (wait));
Example window handle
//------------------------------------
// Handle to window
//------------------------------------
// Set new window handle for image display
is_DirectRenderer (hCam, DR_SET_HWND,
(void*)&hWnd, sizeof (hWnd));
Example compatibility
//------------------------------------
// Compatibility
//------------------------------------
// Check graphics card compatibility
INT nRet = is_DirectRenderer (hCam, DR_CHECK_COMPATIBILITY, NULL, NULL);
if (nRet == IS_DR_DEVICE_CAPS_INSUFFICIENT )
// Graphics card does not support Direct3D