IC Imaging Control .NET

FrameSnapSink.SnapSequence Method

FrameSnapSink.SnapSequence Method

Waits for several images to arrive and then returns the result.
public IFrameQueueBuffer[] SnapSequence( int count, TimeSpan timeout ); public IFrameQueueBuffer[] SnapSequence( IEnumerable<IFrameQueueBuffer> buffersToSnapInto, TimeSpan timeout );
Parameter Description

The time the sink waits for the new images to arrive. When the timeout elapses the buffers that were copied are returned.


The count of frames to create via and wait for.


A list of target buffers to copy the arriving data into. These buffers all must have the same FrameType as the sink. If not a ICException is thrown.


On success returns a array of IFrameQueueBuffer that was filled with the data of the frame that just came in.

When no IFrameQueueBuffer array was passed in, the sink creates this list of FrameQueueBuffers before waiting for new images from the device.

When the timeout elapsed, the buffers already filled are returned. This maybe fewer then requested via count or passed in via buffersToSnapInto.


Introduced in version 3.5


The following example shows how to use SnapSequence and reuse buffers to avoid allocating memory twice.

FrameSnapSink sink = new FrameSnapSink(MediaSubtypes.RGB32); ICImagingControl1.Sink = sink; ICImagingControl1.LiveStart(); int index = 0; IFrameQueueBuffer[] lst = sink.SnapSequence(5, TimeSpan.FromSeconds(5)); foreach( IFrameQueueBuffer frame in lst ) { // do something with each buffer frame.SaveAsBitmap(String.Format("test_{0}.bmp", index++)); } // reusing buffers in a snap sink IFrameQueueBuffer[] lst2 = sink.SnapSequence(lst, TimeSpan.FromSeconds(5)); // save the next buffer sequence foreach( IFrameQueueBuffer frame in lst2 ) { // do something with each buffer frame.SaveAsBitmap(String.Format("test_{0}.bmp", index++)); }
See also : FrameSnapSink, IFrameQueueBuffer, ICException

<< FrameSnapSink

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