次の方法で共有


Capturing an Image From a Still Image Pin (Windows Embedded CE 6.0)

1/6/2010

Some cameras can produce a still image separate from the capture stream, and often the still image is of higher quality than the images produced by the capture stream. The camera may have a button that acts as a hardware trigger, or it may support software triggering. A camera that supports still images will expose a still image pin, which is pin category PIN_CATEGORY_STILL (see Pin Property Set).

To trigger the still pin, use the IAMVideoControl::SetMode method when the graph is running, as shown in the following code.

pControl->Run(); // Run the graph.
IAMVideoControl *pAMVidControl = NULL;
hr = pCap->QueryInterface(IID_IAMVideoControl, (void**)&pAMVidControl);
if (SUCCEEDED(hr))
{
    // Find the still pin.
    IPin *pPin = 0;
    hr = pBuild->FindPin(pCap, PINDIR_OUTPUT, &PIN_CATEGORY_STILL, 0,
        FALSE, 0, &pPin);
    if (SUCCEEDED(hr))
    {
        hr = pAMVidControl->SetMode(pPin, VideoControlFlag_Trigger);
        pPin->Release();
    }
    pAMVidControl->Release();
}

Query the capture filter for an IAMVideoControl interface. If the interface is supported, get a pointer to the still pin's IPin Interface by calling the ICaptureGraphBuilder2::FindPin method, as shown in the previous example.

Note

Depending on the camera, you might need to render the capture pin (PIN_CATEGORY_CAPTURE) before the still pin will connect.

See Also

Concepts

Video Capture Tasks