예제 #1
0
        void IAMMove(VideoCaptureDevice d, CameraControlProperty p, int i)
        {
            int v, minv, maxv, stepSize, defVal;
            CameraControlFlags f, cf;
            d.GetCameraProperty(p, out v, out f);
            d.GetCameraPropertyRange(p, out minv, out maxv, out stepSize, out defVal, out cf);

            int newv = v + i*stepSize;
            if (newv<minv)
                newv = minv;
            if (newv>maxv)
                newv = maxv;

            if (i == 0)
                newv = defVal;

            if (cf== CameraControlFlags.Manual)
            {
                d.SetCameraProperty(p, newv, CameraControlFlags.Manual);
            }
            else
            {
                MainForm.LogMessageToFile("Camera control flags are not manual");
            }
        }