FrameReady
Top  Previous  Next

Description

This event is fired each time a decoded frame is submitted for display.

Syntax


[VB]
Private Sub objActiveGige_FrameReady()


[C/C++]
HRESULT Fire_FrameReady();


Parameters
[C/C++]

None  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This MFC fragment uses the FrameReady event to perform a post-processing of the color video:

 
void CGcamProDlg::OnFrameReadyActivegige1()   
{  
   BYTE *ptr=m_ActiveGige.GetImagePointer(0, m_ActiveGige.GetSizeY()-1);  
   int nSize=m_ActiveGige.GetSizeX()*m_ActiveGige.GetSizeY();  
   int max=255;  
   for(int y=0;y<nSize;y++,ptr++)  
      *ptr=(*ptr+16)*2;  
}     
 

Remarks


The FrameReady event is fired from ActiveGige's display thread which is running separately from the acquisition thread. This allows your post-processing routine to take advantage of a multi-processor or multi-core architecture. Note that If the post-processing procedure is not fast enough, it will only affect the display frame rate and will not result in missed frames in the acquisition thread.

In order to synchronize the post-processing with image display, the Display property should be set to False and Draw method used in the end of the event handler.

One of the following conditions must be met, before the FrameReady event will be fired:
The Acquire property has been set to TRUE  
The Grab method has been called.  

Note - this event may not work in older development environments such as VB6