How to access web camera settings (like in Skype) using DotNet

前端 未结 1 1730
故里飘歌
故里飘歌 2021-01-16 05:29

In my application I need to access my web Camera settings. I saw that Skype calling to the camera\'s settings application. Does anyone know how to do this? I am using C#/WPF

相关标签:
1条回答
  • 2021-01-16 06:09
    [DllImport("user32", EntryPoint = "SendMessage")]
            public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);
    
    [DllImport("avicap32.dll", EntryPoint = "capCreateCaptureWindowA")]
            public static extern int capCreateCaptureWindowA(string lpszWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, int hwndParent, int nID);
    
    
            int mCapHwnd;
            private void btnAdvancedVideoSettings_Click(object sender, RoutedEventArgs e)
            {
                mCapHwnd = capCreateCaptureWindowA("WebCap", 0, 0, 0, 0, 0, 0, 0);
                UIVideoSettingsControl.SendMessage(mCapHwnd, 1034, 0, 0);
                UIVideoSettingsControl.SendMessage(mCapHwnd, 1066, 0, 0);
    
            }
    
    // VIDEOSOURCE  = 1066
    // CONNECT = 1034
    
    0 讨论(0)
提交回复
热议问题