/// <summary> /// Displays a dialog box that enables the user to select a hardware device for image acquisition. /// </summary> /// <param name="deviceType">Device type.</param> /// <param name="alwaysSelect">Option to always show the select device dialog box</param> /// <param name="required">Option to generate an error if the user cancels the dialog box.</param> /// <returns>Selected <see cref="WiaDevice"/> or null when no selection made.</returns> public WiaDevice ShowSelectDevice(WiaDeviceType deviceType, bool alwaysSelect, bool required) { var wiaDevice = _wiaCommonDialog.ShowSelectDevice( (Interop.Wia.WiaDeviceType)(int) deviceType, alwaysSelect, required); return(wiaDevice != null ? new WiaDevice(wiaDevice) : null); }
/// <summary> /// Shows the common "Acquire Image" dialog to acquire an image. /// </summary> /// <param name="deviceType">Device type.</param> /// <param name="intent">Image intent.</param> /// <param name="bias">Image bias.</param> /// <param name="formatId">Image format ID.</param> /// <param name="alwaysSelectDevice">Always prompt to select device.</param> /// <param name="useCommonUI">Use common UI.</param> /// <param name="cancelError">Generate error if canceled.</param> /// <returns>Image file or null when canceled.</returns> public WiaImageFile ShowAcquireImage(WiaDeviceType deviceType, WiaImageIntent intent, WiaImageBias bias, string formatId, bool alwaysSelectDevice, bool useCommonUI, bool cancelError) { var wiaImageFile = _wiaCommonDialog.ShowAcquireImage( (Interop.Wia.WiaDeviceType)(int) deviceType, (Interop.Wia.WiaImageIntent)(int) intent, (Interop.Wia.WiaImageBias)(int) bias, formatId, alwaysSelectDevice, useCommonUI, cancelError); return(wiaImageFile != null ? new WiaImageFile(wiaImageFile) : null); }
private void SetDeviceType(WiaDeviceType deviceType) { _deviceType = deviceType; allDevicesToolStripMenuItem.Checked = (deviceType == WiaDeviceType.UnspecifiedDeviceType); scannersToolStripMenuItem.Checked = (deviceType == WiaDeviceType.ScannerDeviceType); camerasToolStripMenuItem.Checked = (deviceType == WiaDeviceType.CameraDeviceType); videoToolStripMenuItem.Checked = (deviceType == WiaDeviceType.VideoDeviceType); this.LoadDevices(); }
public Device ShowSelectDevice(WiaDeviceType DeviceType = WiaDeviceType.UnspecifiedDeviceType, bool AlwaysSelectDevice = false, bool CancelError = false) { throw new NotImplementedException(); }
public ImageFile ShowAcquireImage(WiaDeviceType DeviceType = WiaDeviceType.UnspecifiedDeviceType, WiaImageIntent Intent = WiaImageIntent.UnspecifiedIntent, WiaImageBias Bias = WiaImageBias.MaximizeQuality, string FormatID = "{00000000-0000-0000-0000-000000000000}", bool AlwaysSelectDevice = false, bool UseCommonUI = true, bool CancelError = false) { throw new NotImplementedException(); }
/// <summary> /// Zeigt den Dialog zur Geräteauswahl an /// </summary> /// <returns>das Gerät, das der Benutzer ausgewählt hat</returns> public static Device FromUserDialog(WiaDeviceType deviceType = WiaDeviceType.UnspecifiedDeviceType, bool alwaysSelectDevice = false) { CommonDialogClass wiaDialog = new CommonDialogClass(); return(wiaDialog.ShowSelectDevice(deviceType, alwaysSelectDevice, false)); }
public static Device FromUserDialog( WiaDeviceType deviceType = WiaDeviceType.UnspecifiedDeviceType, bool alwaysSelectDevice = false) { CommonDialog wiaDialog = new CommonDialog(); return wiaDialog.ShowSelectDevice(deviceType, alwaysSelectDevice, false); }