• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ICameraDevice类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICameraDevice的典型用法代码示例。如果您正苦于以下问题:C# ICameraDevice类的具体用法?C# ICameraDevice怎么用?C# ICameraDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICameraDevice类属于命名空间,在下文中一共展示了ICameraDevice类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Get

 public void Get(ICameraDevice camera)
 {
     Add(GetFrom(camera.Mode, "Mode"));
     Add(GetFrom(camera.CompressionSetting, "CompressionSetting"));
     Add(GetFrom(camera.ExposureCompensation, "ExposureCompensation"));
     Add(GetFrom(camera.ExposureMeteringMode, "ExposureMeteringMode"));
     Add(GetFrom(camera.FNumber, "FNumber"));
     Add(GetFrom(camera.IsoNumber, "IsoNumber"));
     Add(GetFrom(camera.ShutterSpeed, "ShutterSpeed"));
     Add(GetFrom(camera.WhiteBalance, "WhiteBalance"));
     Add(GetFrom(camera.FocusMode, "FocusMode"));
     Add(GetFrom(camera.LiveViewImageZoomRatio, "LiveViewImageZoomRatio"));
     Add(new ValuePair { Name = "CaptureInSdRam", Value = camera.CaptureInSdRam.ToString() });
     Add(new ValuePair { Name = "HostMode", Value = camera.HostMode.ToString() });
     var property = ServiceProvider.Settings.CameraProperties.Get(camera);
     CameraProperty.NoDownload = property.NoDownload;
     CameraProperty.CaptureInSdRam = property.CaptureInSdRam;
     if(camera.AdvancedProperties!=null)
     {
         foreach (PropertyValue<long> propertyValue in camera.AdvancedProperties)
         {
             Add(GetFrom(propertyValue, propertyValue.Name));
         }
     }
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:25,代码来源:CameraPreset.cs


示例2: AstroLiveViewViewModel

 public AstroLiveViewViewModel(ICameraDevice device)
     :base(device)
 {
     ZoomFactor = 1;
     StarWindowSize = 30;
     StarSize = 123.11;
 }
开发者ID:tomriddle1234,项目名称:digiCamControl,代码行数:7,代码来源:AstroLiveViewViewModel.cs


示例3: FileItem

        public FileItem(DeviceObject deviceObject, ICameraDevice device)
        {
            Device = device;
            DeviceObject = deviceObject;
            ItemType = FileItemType.CameraObject;
            FileName = deviceObject.FileName;
            FileDate = deviceObject.FileDate;
            IsChecked = true;
            IsLiked = false;
            IsUnLiked = false;
            if (deviceObject.ThumbData != null && deviceObject.ThumbData.Length > 4)
            {
                try
                {
                    var stream = new MemoryStream(deviceObject.ThumbData, 0, deviceObject.ThumbData.Length);

                    using (var bmp = new Bitmap(stream))
                    {
                        Thumbnail = BitmapSourceConvert.ToBitmapSource(bmp);
                    }
                    stream.Close();
                }
                catch (Exception exception)
                {
                    Log.Debug("Error loading device thumb ", exception);
                }
            }
        }
开发者ID:kwagalajosam,项目名称:digiCamControl,代码行数:28,代码来源:FileItem.cs


示例4: ComponentManager

 public ComponentManager(IComponentConfiguration configuration, IImageProvider imageProvider,
     ICameraDevice cameraDevice)
 {
     device = cameraDevice;
     provider = imageProvider;
     componentConfiguration = configuration;
 }
开发者ID:rachwal,项目名称:RTM-Tools,代码行数:7,代码来源:ComponentManager.cs


示例5: Verify

 public void Verify(ICameraDevice camera)
 {
     try
     {
         camera.Mode.HaveError = camera.Mode.Value != GetValue("Mode");
         camera.CompressionSetting.HaveError = camera.CompressionSetting.Value != GetValue("CompressionSetting");
         camera.ExposureCompensation.HaveError = camera.ExposureCompensation.Value != GetValue("ExposureCompensation");
         camera.ExposureMeteringMode.HaveError = camera.ExposureMeteringMode.Value != GetValue("ExposureMeteringMode");
         camera.FNumber.HaveError = camera.FNumber.Value != GetValue("FNumber");
         camera.IsoNumber.HaveError = camera.IsoNumber.Value != GetValue("IsoNumber");
         camera.ShutterSpeed.HaveError = camera.ShutterSpeed.Value != GetValue("ShutterSpeed");
         camera.WhiteBalance.HaveError = camera.WhiteBalance.Value != GetValue("WhiteBalance");
         camera.FocusMode.HaveError = camera.FocusMode.Value != GetValue("FocusMode");
         if (camera.AdvancedProperties != null)
         {
             foreach (PropertyValue<long> propertyValue in camera.AdvancedProperties)
             {
                 propertyValue.HaveError = propertyValue.Value != GetValue(propertyValue.Name);
             }
         }
     }
     catch (Exception ex)
     {
         Log.Error("Unable to verify the preset " + Name, ex);
     }
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:26,代码来源:CameraPreset.cs


示例6: LiveViewForm

 public LiveViewForm(ICameraDevice cameraDevice)
 {
     //set live view default frame rate to 15
     _liveViewTimer.Interval = 1000 / 15;
     _liveViewTimer.Stop();
     _liveViewTimer.Tick += _liveViewTimer_Tick;
     CameraDevice = cameraDevice;
     CameraDevice.CameraDisconnected += CameraDevice_CameraDisconnected;
     InitializeComponent();
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:10,代码来源:LiveViewForm.cs


示例7: CameraConnected

 public void CameraConnected(ICameraDevice device)
 {
     if (device is FakeCameraDevice)
         return;
     var cameracount = ServiceProvider.DeviceManager.ConnectedDevices.Count -
                       (ServiceProvider.Settings.AddFakeCamera ? 1 : 0);
     SendEvent("Camera", "Connected" , device.DeviceName, cameracount);
     if (cameracount > 1)
         SendEvent("MultipleCamera", "Connected_" + cameracount, device.DeviceName);
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:10,代码来源:Analytics.cs


示例8: Pharse

 public string Pharse(string template, PhotoSession session, ICameraDevice device, string fileName, string tempfileName)
 {
     if (!File.Exists(tempfileName))
         return "";
     FileItem item = new FileItem(tempfileName);
     BitmapLoader.Instance.GetMetadata(item);
     string tag = template.Replace("[", "").Replace("]", "");
     if (item.FileInfo.ExifTags.ContainName(tag))
         return item.FileInfo.ExifTags[tag].Replace(":", "_").Replace("?", "_").Replace("*", "_").Replace("\\", "_"); ;
     return template;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:11,代码来源:ExifTemplate.cs


示例9: Capture

 private void Capture(ICameraDevice device)
 {
     try
     {
         CameraHelper.Capture(device);
     }
     catch (Exception e)
     {
         StaticHelper.Instance.SystemMessage = e.Message;
     }
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:11,代码来源:CaptureAll.cs


示例10: StopLiveView

 public static void StopLiveView(ICameraDevice device)
 {
     device.StopLiveView();
     if (device is NikonBase)
     {
         if (_recordtoRam.ContainsKey(device))
             device.CaptureInSdRam = _recordtoRam[device];
         if (_hostMode.ContainsKey(device))
             device.HostMode = _hostMode[device];
     }
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:11,代码来源:LiveViewManager.cs


示例11: BraketingWnd

 public BraketingWnd(ICameraDevice device, PhotoSession session)
 {
     InitializeComponent();
       _device = device;
       _photoSession = session;
       _photoSession.Braketing.IsBusy = false;
       backgroundWorker.DoWork += delegate { _photoSession.Braketing.TakePhoto(ServiceProvider.DeviceManager.SelectedCameraDevice); };
       _photoSession.Braketing.IsBusyChanged += Braketing_IsBusyChanged;
       _photoSession.Braketing.PhotoCaptured += Braketing_PhotoCaptured;
       _photoSession.Braketing.BracketingDone += Braketing_BracketingDone;
       ServiceProvider.Settings.ApplyTheme(this);
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:12,代码来源:BraketingWnd.xaml.cs


示例12: Get

 public CameraProperty Get(ICameraDevice device)
 {
     if (device == null)
         return new CameraProperty();
     foreach (CameraProperty cameraProperty in Items)
     {
         if (cameraProperty.SerialNumber == device.SerialNumber)
             return cameraProperty;
     }
     var c = new CameraProperty() {SerialNumber = device.SerialNumber, DeviceName = device.DisplayName};
     Items.Add(c);
     return c;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:13,代码来源:CameraPropertyEnumerator.cs


示例13: ExecuteCommand

        public void ExecuteCommand(string cmd, object param)
        {
            switch (cmd)
            {
                case WindowsCmdConsts.CameraPropertyWnd_Show:
                    PhotoSessionNames.Clear();
                    PhotoSessionNames.Add("(None)");
                    foreach (PhotoSession photoSession in ServiceProvider.Settings.PhotoSessions)
                    {
                        PhotoSessionNames.Add(photoSession.Name);
                    }
                    CameraPresets.Clear();
                    CameraPresets.Add("(None)");
                    foreach (var cameraPresets in ServiceProvider.Settings.CameraPresets)
                    {
                        CameraPresets.Add(cameraPresets.Name);
                    }

                    _cameraDevice = param as ICameraDevice;
                    if (_cameraDevice == null)
                        return;
                    CameraProperty = _cameraDevice.LoadProperties();
                    CameraProperty.BeginEdit();
                    Dispatcher.Invoke(new Action(delegate
                    {
                        Show();
                        Activate();
                        Topmost = true;
                        //Topmost = false;
                        Focus();
                    }));
                    break;
                case WindowsCmdConsts.CameraPropertyWnd_Hide:
                    CameraProperty = null;
                    Hide();
                    break;
                case CmdConsts.All_Close:
                    Dispatcher.Invoke(new Action(delegate
                                                   {
                                                       Hide();
                                                       Close();
                                                   }));
                    break;
            }
        }
开发者ID:kwagalajosam,项目名称:digiCamControl,代码行数:45,代码来源:CameraPropertyWnd.xaml.cs


示例14: StartLiveView

 public static void StartLiveView(ICameraDevice device)
 {
     // some nikon cameras can set af to manual
     //force to capture in ram
     if (device is NikonBase)
     {
         if (!_recordtoRam.ContainsKey(device))
             _recordtoRam.Add(device, device.CaptureInSdRam);
         else
             _recordtoRam[device] = device.CaptureInSdRam;
         device.CaptureInSdRam = true;
         if (!_hostMode.ContainsKey(device))
             _hostMode.Add(device, device.HostMode);
         else
             _hostMode[device] = device.HostMode;
         device.HostMode = true;
     }
     device.StartLiveView();
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:19,代码来源:LiveViewManager.cs


示例15: DownLoadFileByWebRequest

        public static void DownLoadFileByWebRequest(string urlAddress, string filePath, ICameraDevice device)
        {
            try
            {
                HttpWebRequest request = null;
                HttpWebResponse response = null;
                request = (HttpWebRequest)WebRequest.Create(urlAddress);
                request.Timeout = 30000;  //8000 Not work
                response = (HttpWebResponse)request.GetResponse();
                Stream s = response.GetResponseStream();
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }

                FileStream os = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write);
                byte[] buff = new byte[102400];
                int c = 0;
                while ((c = s.Read(buff, 0, 102400)) > 0)
                {
                    os.Write(buff, 0, c);
                    os.Flush();
                    device.TransferProgress += 1;
                }
                os.Close();
                s.Close();
                device.TransferProgress = 100;
            }
            catch
            {
                return;
            }
            finally
            {
            }
        }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:36,代码来源:HttpHelper.cs


示例16: GetExample

        public string GetExample(string res, PhotoSession session, ICameraDevice device, string fileName)
        {
            Regex regPattern = new Regex(@"\[(.*?)\]", RegexOptions.Singleline);
            MatchCollection matchX = regPattern.Matches(res);
            foreach (Match match in matchX)
            {
                if (ServiceProvider.FilenameTemplateManager.Templates.ContainsKey(match.Value))
                {
                    res = res.Replace(match.Value,
                        ServiceProvider.FilenameTemplateManager.Templates[match.Value].Pharse(match.Value, session, device,
                            fileName));
                }
            }

            //prevent multiple \ if a tag is empty 
            while (res.Contains(@"\\"))
            {
                res = res.Replace(@"\\", @"\");
            }
            // if the file name start with \ the Path.Combine isn't work right 
            if (res.StartsWith("\\"))
                res = res.Substring(1);
            return res;
        }
开发者ID:tomriddle1234,项目名称:digiCamControl,代码行数:24,代码来源:FilenameTemplateManager.cs


示例17: Pharse

 public string Pharse(string template, PhotoSession session, ICameraDevice device, string fileName)
 {
     CameraProperty property = device.LoadProperties();
     switch (template)
     {
         case "[Counter 3 digit]":
         case "[Counter 4 digit]":
         case "[Counter 5 digit]":
         case "[Counter 6 digit]":
         case "[Counter 7 digit]":
         case "[Counter 8 digit]":
         case "[Counter 9 digit]":
             return session.Counter.ToString(new string('0', Convert.ToInt16(template.Substring(9, 1))));
         case "[Series 4 digit]":
             return session.Series.ToString(new string('0', 4));
         case "[Camera Counter 3 digit]":
         case "[Camera Counter 4 digit]":
         case "[Camera Counter 5 digit]":
         case "[Camera Counter 6 digit]":
         case "[Camera Counter 7 digit]":
         case "[Camera Counter 8 digit]":
         case "[Camera Counter 9 digit]":
             return property.Counter.ToString(new string('0', Convert.ToInt16(template.Substring(16, 1))));
         case "[Session Name]":
             return session.Name;
         case "[Capture Name]":
             return session.CaptureName;
         case "[Exposure Compensation]":
             if (device!=null && device.ExposureCompensation != null)
                 return device.ExposureCompensation.Value != "0" ? device.ExposureCompensation.Value : "";
             return "";
         case "[FNumber]":
             if (device != null && device.FNumber != null)
                 return device.FNumber.Value ?? "";
             return "";
         case "[Date yyyy-MM-dd]":
             return DateTime.Now.ToString("yyyy-MM-dd");
         case "[Date yyyy]":
             return DateTime.Now.ToString("yyyy");
         case "[Date yyyy-MM]":
             return DateTime.Now.ToString("yyyy-MM");
         case "[Date MMM]":
             return DateTime.Now.ToString("MMM");
         case "[Date yyyy-MM-dd-hh-mm-ss]":
             return DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss");
         case "[Time hh-mm-ss]":
             return DateTime.Now.ToString("hh-mm-ss");
         case "[Time hh-mm]":
             return DateTime.Now.ToString("hh-mm");
         case "[Time hh]":
             return DateTime.Now.ToString("hh");
         case "[Barcode]":
             return session.Barcode;
         case "[File format]":
             return GetType(fileName);
         case "[Original Filename]":
             return Path.GetFileNameWithoutExtension(fileName);
         case "[Camera Name]":
             return property.DeviceName.Replace(":", "_").Replace("?", "_").Replace("*", "_");
         case "[Selected Tag1]":
             return session.SelectedTag1 != null ? session.SelectedTag1.Value.Trim() : "";
         case "[Selected Tag2]":
             return session.SelectedTag2 != null ? session.SelectedTag2.Value.Trim() : "";
         case "[Selected Tag3]":
             return session.SelectedTag3 != null ? session.SelectedTag3.Value.Trim() : "";
         case "[Selected Tag4]":
             return session.SelectedTag4 != null ? session.SelectedTag4.Value.Trim() : "";
         case "[Unix Time]":
             var date = new DateTime(1970, 1, 1, 0, 0, 0, DateTime.Now.Kind);
             var unixTimestamp = System.Convert.ToInt64((DateTime.Now - date).TotalSeconds);
             return unixTimestamp.ToString();
         case "[DB Row 1]":
             return (session.ExternalData != null && session.ExternalData.Row1 != null)
                 ? session.ExternalData.Row1
                 : "";
         case "[DB Row 2]":
             return (session.ExternalData != null && session.ExternalData.Row2 != null)
                 ? session.ExternalData.Row2
                 : "";
         case "[DB Row 3]":
             return (session.ExternalData != null && session.ExternalData.Row3 != null)
                 ? session.ExternalData.Row3
                 : "";
         case "[DB Row 4]":
             return (session.ExternalData != null && session.ExternalData.Row4 != null)
                 ? session.ExternalData.Row4
                 : "";
         case "[DB Row 5]":
             return (session.ExternalData != null && session.ExternalData.Row5 != null)
                 ? session.ExternalData.Row5
                 : "";
         case "[DB Row 6]":
             return (session.ExternalData != null && session.ExternalData.Row6 != null)
                 ? session.ExternalData.Row6
                 : "";
         case "[DB Row 7]":
             return (session.ExternalData != null && session.ExternalData.Row7 != null)
                 ? session.ExternalData.Row7
                 : "";
         case "[DB Row 8]":
//.........这里部分代码省略.........
开发者ID:avencherus,项目名称:digiCamControl,代码行数:101,代码来源:FilenameTemplate.cs


示例18: TakePhoto

 public void TakePhoto(ICameraDevice device)
 {
     _cameraDevice = device;
     Log.Debug("Bracketing started");
     _cameraDevice.CaptureCompleted += _cameraDevice_CaptureCompleted;
     IsBusy = true;
     switch (Mode)
     {
         case 0:
             {
                 if (ExposureValues.Count == 0)
                 {
                     Stop();
                     return;
                 }
                 Index = 0;
                 try
                 {
                     _defec = _cameraDevice.ExposureCompensation.Value;
                     Thread.Sleep(100);
                     _cameraDevice.ExposureCompensation.SetValue(ExposureValues[Index]);
                     Thread.Sleep(100);
                     CameraHelper.Capture(_cameraDevice);
                     Index++;
                 }
                 catch (DeviceException exception)
                 {
                     Log.Error(exception);
                     StaticHelper.Instance.SystemMessage = exception.Message;
                 }
             }
             break;
         case 1:
             {
                 if (ShutterValues.Count == 0)
                 {
                     Stop();
                     return;
                 }
                 Index = 0;
                 try
                 {
                     _defec = _cameraDevice.ShutterSpeed.Value;
                     Thread.Sleep(100);
                     _cameraDevice.ShutterSpeed.SetValue(ShutterValues[Index]);
                     Thread.Sleep(100);
                     CameraHelper.Capture(_cameraDevice);
                     Index++;
                 }
                 catch (DeviceException exception)
                 {
                     Log.Error(exception);
                     StaticHelper.Instance.SystemMessage = exception.Message;
                 }
             }
             break;
         case 2:
             {
                 if (PresetValues.Count == 0)
                 {
                     Stop();
                     return;
                 }
                 Index = 0;
                 try
                 {
                     _cameraPreset.Get(_cameraDevice);
                     Thread.Sleep(100);
                     CameraPreset preset = ServiceProvider.Settings.GetPreset(PresetValues[Index]);
                     if (preset != null)
                         preset.Set(_cameraDevice);
                     Thread.Sleep(100);
                     CameraHelper.Capture(_cameraDevice);
                     Index++;
                 }
                 catch (DeviceException exception)
                 {
                     Log.Error(exception);
                     StaticHelper.Instance.SystemMessage = exception.Message;
                 }
             }
             break;
         case 3:
             {
                 if (ApertureValues.Count == 0)
                 {
                     Stop();
                     return;
                 }
                 Index = 0;
                 try
                 {
                     _defec = _cameraDevice.FNumber.Value;
                     Thread.Sleep(100);
                     _cameraDevice.FNumber.SetValue(ApertureValues[Index]);
                     Thread.Sleep(100);
                     CameraHelper.Capture(_cameraDevice);
                     Index++;
                 }
                 catch (DeviceException exception)
//.........这里部分代码省略.........
开发者ID:tomriddle1234,项目名称:digiCamControl,代码行数:101,代码来源:BraketingClass.cs


示例19: OnCameraDisconnected

 /// <summary>
 /// Raise CameraDisconnected event.
 /// </summary>
 /// <param name="cameraDevice">The camera device.</param>
 public void OnCameraDisconnected(ICameraDevice cameraDevice)
 {
     if (CameraDisconnected != null)
         CameraDisconnected(cameraDevice);
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:9,代码来源:CameraDeviceManager.cs


示例20: NewCameraConnected

 private void NewCameraConnected(ICameraDevice cameraDevice)
 {
     StaticHelper.Instance.SystemMessage = "New Camera is connected ! Driver :" + cameraDevice.DeviceName;
     Log.Debug("===========Camera is connected==============");
     Log.Debug("Driver :" + cameraDevice.GetType().Name);
     Log.Debug("Name :" + cameraDevice.DeviceName);
     Log.Debug("Manufacturer :" + cameraDevice.Manufacturer);
     if (CameraConnected != null)
         CameraConnected(cameraDevice);
     SelectedCameraDevice = cameraDevice;
     cameraDevice.PhotoCaptured += cameraDevice_PhotoCaptured;
     cameraDevice.CameraDisconnected += cameraDevice_CameraDisconnected;
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:13,代码来源:CameraDeviceManager.cs



注:本文中的ICameraDevice类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICancelProgressHandler类代码示例发布时间:2022-05-24
下一篇:
C# ICamera2D类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap