public WebCam(WebCams host, string name, string camId, FrameSize[] frameSizes) { _host = host; Name = name; CamId = camId; _frameSizes = frameSizes; FrameSize defaultFrameRes = _frameSizes.FirstOrDefault(f => f.Height == 240 && f.Width == 320); FrameSize = defaultFrameRes.Empty ? _frameSizes.FirstOrDefault() : defaultFrameRes; }
public bool SetFrameSize(IWebCam webCam, FrameSize size) { lock (_objSync) { AssertDisposed(); if (webCam == null) { return(false); } ((WebCam)webCam).FrameSize = size; VideoCaptureDevice vcd; if (_capturingCams.TryGetValue(webCam, out vcd)) { vcd.VideoResolution = vcd.VideoCapabilities.FirstOrDefault(vc => size.Equals(vc.FrameSize)); } return(true); } }
public bool SetFrameSize(FrameSize size) { return(_host.SetFrameSize(this, size)); }