Example #1
0
        private void cmbDevice_SelectedIndexChanged(object sender, EventArgs e)
        {
            selected = cmbDevice.SelectedItem as TCamDevice;
            if (selected != null)
            {
                selected.ShowWindow(pboxLocal);

                selected.ImageCaptured += new TCamDevice.WebCamEventHandler(this.ImgCaptured);
            }
        }
        public static TCamDevice[] GetAllDevices()
        {
            devices = new ArrayList();

            String dName    = "".PadRight(100);
            String dVersion = "".PadRight(100);

            for (short i = 0; i < 10; i++)
            {
                if (capGetDriverDescriptionA(i, ref dName, 100, ref dVersion, 100))
                {
                    TCamDevice d = new TCamDevice(i);
                    d.Name    = dName.Trim();
                    d.Version = dVersion.Trim();

                    devices.Add(d);
                }
            }

            return((TCamDevice[])devices.ToArray(typeof(TCamDevice)));
        }