IC Imaging Control C++

Grabber::setWindowSize Method

Grabber::setWindowSize Method

Sets the size of the video window.
Syntax:
bool setWindowSize( long width, long height );
Parameter Description
width

Specifies the width of the video window.

height

Specifies the height of the video window.

Return value:

true on success, false otherwise.

Remarks:

The size of the live video window can only be set, if Grabber::getDefaultWindowPosition returns false. If an application wants to alter the size of the live video window, it should call Grabber::setDefaultWindowPosition(false) first.

Sample:

This example demonstrates how to set the size of the grabber's live video window.

long width  = 150;
long height = 100;
// Check whether the window position and size can be set
if( grabber.getDefaultWindowPosition() == true )
{
    printf("Default window position is enabled.\n");
    printf("It is not possible to set the window position and size now!\n");
}
else
{
    if( grabber.setWindowSize( width, height ) == true )
    {
        printf("New window size is %d %d\n", width, height);
    }
    else
    {
        printf("Failed to set the new window size!\n");
    }
}
See also: Grabber, Grabber::setWindowPosition, Grabber::getWindowPosition, Grabber::setDefaultWindowPosition, Grabber::getDefaultWindowPosition

<< Grabber

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us