# Handle Image Acquisition

Copy

    // This method handles image acquisition.
    // If m_acquireMode = Acquire, this function gets the freshly
    // acquired image from the Acq Fifo and puts it in our Display.
    // If m_acquireMode = StartAcquire, this function calls StartAcquire.
    // An event receiver is responsible for completing this acquisition
    // by way of calling the CompleteAcquire() function.
    void CSimpleAcquisitionDlg::SimpleAcquire() {

    // Handle image acquisition
    try
    {
        switch (m_acquireMode) {
        case AcquireMode::Acquire:
        {
            int triggerNumber;

            m_image = m_acqFifo->Acquire(triggerNumber);
            m_display.setImage(m_image);
            break;
        }
        case AcquireMode::StartAcquire:
        {
            m_acqFifo->StartAcquire();
            break;
        }
        case AcquireMode::Camera:
        case AcquireMode::Uninitialized:
        {
            // Do nothing
            break;
        }
        default:
        {
            LogToTextbox("The specified acquisition mode is invalid.");
            break;
        }
        }
    }
        catch (VisionException ex)
        {
            LogToTextbox("Unable to acquire. " + ex.Message());
        }
    }