SetVideoPosition (DVR version only)
Top  Previous  Next


Seeks the specified frame in the currently open video file or memory sequence, extracts it and displays in the ActiveGige window.


objActiveGige.SetVideoPosition Frame [, Mode=0 ]

HRESULT SetVideoPosition(long Frame, short Mode);

Data Types

Frame: Long
Mode: Integer


Frame [in]  
The zero-based index of the frame to set.  
Mode [in]  
If 0, Frame will be used as an absolute zero-based position of the frame in the file or sequence.  
If 1, Frame will be used as an incremental move relative to the current frame position (i.e. Frame=2 will move the video position two frames forward, while Frame=-2 will move it two frames back.  

Return Values



This VB example shows how to use a scroll bar to move between the frames in the AVI file.

Private Sub Form_Load()  
ActiveGige1.OpenVideo "C:\\video1.avi"  
HScroll1.Max=ActiveGige1.GetVideoFrameCount - 1  
End Sub  
Private Sub HScroll1_Scroll()  
frameposition = HScroll1.Value  
ActiveGige1.SetVideoPosition frameposition  
End Sub  


This method extracts the specified frame from the video file or memory sequence and loads it into the internal ActiveGige buffer. The FrameLoaded event will be fired, when SetVideoPosition is called successfully. The pixels of the loaded frame can be accessed via ActiveGige image access functions (GetImageData, GetImagePointer, GetImageWindow etc).

The speed at which a random frame can be extracted from a video file depends on the performance of the hard drive and the compression used during the recording.

If the frame is extracted from a memory sequence, all current conversion properties (such as Bayer, WindowLevel, BkgCorrect, Rotate) will be applied to the frame for the display.

Calling this method will automatically turn off the live video by setting the Acquire property to FALSE.