本文整理汇总了C#中ICameraDevice类的典型用法代码示例。如果您正苦于以下问题:C# ICameraDevice类的具体用法?C# ICameraDevice怎么用?C# ICameraDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICameraDevice类属于命名空间,在下文中一共展示了ICameraDevice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
}
示例2: AstroLiveViewViewModel
public AstroLiveViewViewModel(ICameraDevice device)
:base(device)
{
ZoomFactor = 1;
StarWindowSize = 30;
StarSize = 123.11;
}
示例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);
}
}
}
示例4: ComponentManager
public ComponentManager(IComponentConfiguration configuration, IImageProvider imageProvider,
ICameraDevice cameraDevice)
{
device = cameraDevice;
provider = imageProvider;
componentConfiguration = configuration;
}
示例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);
}
}
示例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();
}
示例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);
}
示例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;
}
示例9: Capture
private void Capture(ICameraDevice device)
{
try
{
CameraHelper.Capture(device);
}
catch (Exception e)
{
StaticHelper.Instance.SystemMessage = e.Message;
}
}
示例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];
}
}
示例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);
}
示例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;
}
示例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;
}
}
示例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();
}
示例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
{
}
}