SetVideoPosition (DVR version only)
Top  Previous  Next

Description

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

Syntax


[VB]
objActiveGige.SetVideoPosition Frame [, Mode=0 ]


[C/C++]
HRESULT SetVideoPosition(long Frame, short Mode);


Data Types
[VB]

Frame: Long
Mode: Integer

Parameters
[C/C++]

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

S_OK  
Success  
E_FAIL  
Failure.  

Example


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.Min=0  
HScroll1.Max=ActiveGige1.GetVideoFrameCount - 1  
End Sub  
 
Private Sub HScroll1_Scroll()  
frameposition = HScroll1.Value  
ActiveGige1.SetVideoPosition frameposition  
End Sub  
 

Remarks


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.