Acquiring from a Live DisplayCognex VisionPro

The same ICogAcqFifo object can be used to acquire an image while simultaneously displaying live video from the same camera. Use the StartLiveDisplay method to start a live display in a CogDisplay control, and the Acquire method to acquire images. See the topic Acquiring Images with a CCD Camera and Frame Grabber for more information on acquiring images.

The following C# statements are taken from a .NET Windows application with a Windows form containing two CogDisplay controls and three buttons:

private int tNum;
private CogFrameGrabbers myFrameGrabbers;
private ICogAcqFifo myFifo;

private void InitializeFifo()
{
        myFrameGrabbers = new CogFrameGrabbers();
        myFifo = myFrameGrabbers[0].CreateAcqFifo("Sony XC75 640x480",
                Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);
}

private void button1_Click(object sender, System.EventArgs e)
{
        cogDisplay1.StartLiveDisplay(myFifo, false);
}

private void button2_Click(object sender, System.EventArgs e)
{
        cogDisplay2.Image = myFifo.Acquire(out tNum);                
}

private void button3_Click(object sender, System.EventArgs e)
{
        cogDisplay1.StopLiveDisplay();
}