显示VFW设备对话框

Display VFW Capture Dialog Boxes

A capture device that still uses a Video for Windows (VFW) driver can support any of the following three dialog boxes, which are used to configure the device.

Dialog boxDescription
Video SourceUsed to select the video input and to adjust device settings, such as picture brightness or contrast.
Video FormatUsed to select the image dimensions and bit depth.
Video DisplayUsed to control the appearance of the rendered video.

 

To show one of these dialog boxes, do the following:

  1. Stop the filter graph.
  2. Query the capture filter for the IAMVfwCaptureDialogs interface. If QueryInterface succeeds, it means the capture device is a VFW device.
  3. Call IAMVfwCaptureDialogs::HasDialog to check if the driver supports the dialog box that you wish to display. TheVfwCaptureDialogs enumeration defines flags for each of the VFW dialog boxes. HasDialog returns S_OK if the dialog box is supported. It returns S_FALSE otherwise, so check for the value S_OK directly, rather than using the SUCCEEDEDmacro.
  4. If the dialog box is supported, call IAMVfwCaptureDialogs::ShowDialog to display the dialog box.
  5. Restart the graph.

The following code shows these steps for the Video Source dialog box:

C++
 
pControl->Stop(); // Stop the graph.

// Query the capture filter for the IAMVfwCaptureDialogs interface.
IAMVfwCaptureDialogs *pVfw = 0;
hr = pCap->QueryInterface(IID_IAMVfwCaptureDialogs, (void**)&pVfw);
if (SUCCEEDED(hr))
{
    // Check if the device supports this dialog box.
    if (S_OK == pVfw->HasDialog(VfwCaptureDialog_Source))
    {
        // Show the dialog box.
        hr = pVfw->ShowDialog(VfwCaptureDialog_Source, hwndParent);
    }
}
pControl->Run();

摘自:http://msdn.microsoft.com/en-us/library/windows/desktop/dd375484(v=vs.85).aspx

转载于:https://www.cnblogs.com/Earth-Shaker/p/3676093.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值