Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/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::SetModemethod when the graph is running, as shown in the following code.

Copy 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 Interfaceby calling the ICaptureGraphBuilder2::FindPinmethod, 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