PXL_RETURN_CODE PxLSetPreviewState (

   HANDLE hCamera,

   U32    previewState,

   HWND*  phWnd );



This function establishes the operating state of the preview window.

  • hCamera is the camera handle.  This value is returned by PxLInitialize

  • previewState is the new preview state. Valid preview flags are: 

    • START_PREVIEW—The preview window is running.

    • PAUSE_PREVIEW—Resources are allocated for the preview window.  The preview window, however, is not running and the host CPU is minimizing CPU cycles on this task.

    • STOP_PREVIEW—The preview window is stopped and there are no resources allocated to the preview window


                    These values are defined in the file PixeLINKTypes.h. 

  • phWnd is the pointer to the variable receiving the window handle of the preview window. 

Comments, Restrictions and  Limitations

Before this function is called, the camera defined by the handle hCamera must be streaming video.  Use the PxLSetStreamState function with the stream state set to START_STREAM.

While preview is running, avoid calling the PxLGetNextFrame function as this will reduce the frame rate to the preview window.  To get a separate frame, pause the preview window. 

This function can be called without a previous call to the PxLSetPreviewSettings function.  In this case, the default parameters in the PxLSetPreviewSettings function are assumed.