示例#1
0
 private void SetDeviceProperty(VideoProperty prop, MediaCaptureInfo.PropertyInfo propInfo, MediaCaptureConfiguration.PropertyValue <bool> value)
 {
     if (propInfo.Supported)
     {
         VideoPropertyFlags flag = (propInfo.AutoControlled && value.Auto) ? VideoPropertyFlags.Auto : VideoPropertyFlags.Manual;
         this.camera.SetProperty(prop, value.Value ? 1 : 0, flag);
     }
 }
示例#2
0
 private void SetDeviceProperty(ManagedCameraControlProperty prop, MediaCaptureInfo.PropertyInfo propInfo, MediaCaptureConfiguration.PropertyValue <int> value)
 {
     if (propInfo.Supported)
     {
         ManagedCameraControlPropertyFlags flag = (propInfo.AutoControlled && value.Auto) ? ManagedCameraControlPropertyFlags.Auto : ManagedCameraControlPropertyFlags.Manual;
         this.camera.SetProperty(prop, value.Value, flag);
     }
 }
示例#3
0
        private MediaCaptureInfo.PropertyInfo GetInfo(VideoProperty prop)
        {
            MediaCaptureInfo.PropertyInfo info = new MediaCaptureInfo.PropertyInfo();
            int min = 0, max = 0, stepSize = 0, defValue = 0, flag = 0;

            if (this.camera.GetRange(prop, ref min, ref max, ref stepSize, ref defValue, ref flag))
            {
                info.MinValue       = min;
                info.MaxValue       = max;
                info.StepSize       = stepSize;
                info.DefaultValue   = defValue;
                info.AutoControlled = (flag == (int)VideoPropertyFlags.Auto) ? true : false;
                info.Supported      = true;
            }
            else
            {
                info.Supported = false;
            }

            return(info);
        }