IC Imaging Control C++

Grabber::getVideoDataDimension Method

Grabber::getVideoDataDimension Method

Returns the actual dimension of the image data which is passed to the display. This may be different from the video format of the currently active video capture device, if you have used setDeviceFrameFilters or setDisplayFrameFilters to insert frame filters in the image stream behind the device or in front of the display. If IFrameFilter objects are used by the FrameHandlerSink, the dimension of the MemBufferCollection may be different from the video data dimension as well.
bool getVideoDataDimension( SIZE& dim ) const;
Parameter Description

Size of the image data.

Return value:

true, if the operation was successful. If an error occurred, call getLastError to obtain extended error information.


You can only retrieve this information, when the image stream has been setup by a call to either prepareLive or startLive.


Introduced in version 3.0


The following example uses the ROI filter from stdfilters.ftf to resize the video format of the live display.

Grabber grabber;
// Create an instance of the ROI filter, and let the user change the ROI
smart_com<IFrameFilter> pROIFilter = FilterLoader::createFilter( "ROI" );
pROIFilter->callDialog( 0 );
// Set the filter, and call prepareLive.
grabber.setDisplayFrameFilters( pROIFilter.get() );
grabber.prepareLive( true );
// After prepareLive has been called, getVideoDataDimension returns the size of the
// live display.
SIZE dim;
if( grabber.getVideoDataDimension( dim ) )
    std::cout << "Display video format: " << dim.cx << "x" << dim.cy << std::endl;
    std::cerr << "Unable to determine display video format" << std::endl;

After prepareLive has been called, getVideoDataDimension returns the size of the live display video format.

See also: Grabber, Grabber::prepareLive, Grabber::startLive

<< 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