IC Imaging Control C++

Grabber::setWindowSize Method

Grabber::setWindowSize Method

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

Specifies the width of the video window.


Specifies the height of the video window.

Return value:

true on success, false otherwise.


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.


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");
    if( grabber.setWindowSize( width, height ) == true )
        printf("New window size is %d %d\n", width, height);
        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, video converters and embedded vision components for factory automation, quality assurance, medicine, science, security and a variety of other markets.

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

ISO 9001:2015 certified MVTEC | Edge AI + Vision Alliance | EMVA

Contact us