Ejemplo n.º 1
0
 public int CompareTo(object obj)
 {
     if (obj is WebcamConfiguration)
     {
         WebcamConfiguration y = (WebcamConfiguration)obj;
         return(this.GetHashCode() - y.GetHashCode());
     }
     else
     {
         return(int.MinValue);
     }
 }
        internal void SetResolutions(WebcamConfiguration[] resolutions)
        {
            if (resolutions.Length == 0) {
                Enabled = false;
                return;
            } else {
                Enabled = true;
            }

            m_resolutions = resolutions;

            // gather a distinct list of resolutions and sort it
            m_distinctResolutions.Clear();
            for (int x = 0; x < m_resolutions.Length; x++) {
                if (!m_distinctResolutions.Contains(m_resolutions[x].Size)) {
                    m_distinctResolutions.Add(m_resolutions[x].Size);
                }
            }
            m_distinctResolutions.Sort((Comparison<Size>)delegate(Size x, Size y) {
                if ((x.Width == y.Width) && (x.Height == y.Height)) {
                    return 0;
                } else if ((x.Width < y.Width) && (x.Height < y.Height)) {
                    return -2;
                } else if ((y.Width < x.Width) && (y.Height < x.Height)) {
                    return 2;
                } else if (x.Width < y.Width) {
                    return -1;
                } else {
                    return 1;
                }
            });

            webCamResolution.Minimum = 0;
            webCamResolution.Maximum = m_distinctResolutions.Count - 1;
            webCamResolution.SmallChange = 1;
            webCamResolution.LargeChange = 1;
            webCamResolution.Value = m_distinctResolutions.Count - 1;
            webCamResolution_Scroll(null, null);

            // try default to 640x480x24
            FocusItem(new Size(640, 480), 24);
        }
Ejemplo n.º 3
0
 internal override void Config(WebcamConfiguration configuration)
 {
 }