video_display_get_attributes End of trail navigation bar

Table of Contents

video_display_close

Close the video display window.

Description

The video_display_close function closes the video display window. The window should not be used after it is closed.

Prototype

t_error
video_display_close(t_video_window window);
    

Parameters

t_video_window window

The handle to the window returned by video_display_open.

Return value

The return value is 0 if the operation is successfully. Otherwise a negative error code is returned. Error codes are defined in quanser_errors.h. A suitable error message may be retrieved using msg_get_error_message.

Error codes

QERR_INVALID_ARGUMENT

One of the arguments is invalid.

Requirements

Include Files

Libraries

quanser_video.h

quanser_media.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib

Examples

t_video_window window;

/* Open a video display window for displaying the captured video */
result = video_display_open("Video Capture", NULL, &window);
if (result >= 0) {
    t_video_display display;

    /* Attach a display object to the window for receiving the video stream */
    result = video_display_attach(window, 30.0, 640, 480, IMAGE_FORMAT_COL_MAJOR_PLANAR_RGB, IMAGE_DATA_TYPE_UINT8, true, &display);
    if (result >= 0) {
        ...

        /* Write the frame to the display */
        video_display_write(display, image, frame_width * frame_height * 3);

        ...

        /* Detach the video stream from the display */
        video_display_detach(display);
    }

    /* Close the video display window */
    video_display_close(window);
}
    

See Also

 

navigation bar