Click or drag to resize

Device Methods

The Device type exposes the following members.

Methods
  NameDescription
Public methodCode exampleAcquire
Acquires an image from this device.
Public methodCanOpen Obsolete.

This method may be removed in a future version. New applications should use the TryOpen() method instead.

Returns a value indicating whether or not the Open() method can currently be used on the device.

Public methodClearBuffers

This lets you choose how the device should handle its buffer clearing procedure.

Public methodClose

Closes the connection with the device previously opened.

Calling this method when an image is being acquired will cancel the acquisition and any pending transfers. If you want to close the connection after all images have been transferred, you should do so in the AcquireFinished event.

Public methodDisable
This method will disable and hide the device interface. This only needs to be called if the Enable() method is used to display the interface or invoke scanning.
Public methodDispose
Releases resources used by the device when created from the CreateDeviceSession(String) method. This should not be used for Device objects in the DeviceCollection.
Public methodEnable
This method can be used to display the device interface and invoke an acquisition instead of using Acquire().
Public methodEnableCamera
Use this method to enable or disable cameras used when scanning.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Calls Close()
(Overrides Object.Finalize().)
Public methodGetConditionCode
Returns the condition code from the last Twain operation. This can provide more information about a failure when getting or setting a Device property.
Public methodGetFrames
Returns an array containing the current frames set for a device.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetQueryOperations
Returns the operations supported for a specific capability.
Public methodGetSupportedBarCodes
Returns the barcodes supported by the device.
Public methodGetSupportedBitDepthReductionModes
Returns the BitDepthReductionModes supported by the device.
Public methodGetSupportedBitDepths
Returns the supported bit depth values for the current PixelType.
Public methodGetSupportedBrightnessValues
Returns the brightness values supported by the device.
Public methodGetSupportedCapabilities
Returns a list of all the capabilities for which the Source will answer inquiries.
Public methodGetSupportedCompressionModes
Returns the supported compression modes for this device.
Public methodGetSupportedContrastValues
Returns the contrast values supported by the device.
Public methodGetSupportedExposureTimes
Returns an array of exposure times supported by the device.
Public methodGetSupportedExtendedCapabilities
Returns the extended capabilities supported by the device.
Public methodGetSupportedFlashModes
Returns the flash modes supported by the device.
Public methodGetSupportedFrameSizes
Returns the frame sizes supported by the device.
Public methodGetSupportedHalftones
Returns the halftone values supported by the device.
Public methodGetSupportedHighlightValues
Returns the highlight values supported by the device.
Public methodGetSupportedIccProfileOptions
Returns an array of TwainIccProfileOption values indicating what type of ICC profiles are supported by the device.
Public methodGetSupportedImageFilters
Returns the image filters supported by the device.
Public methodCode exampleGetSupportedImageFormats
Returns a list of the file formats supported by this device.
Public methodGetSupportedJobControls
Returns the job controls supported by the device.
Public methodGetSupportedJpegPixelTypes
Returns the Jpeg pixel types supported by the device.
Public methodGetSupportedJpegQualityValues
Returns the Jpeg quality values supported by the device.
Public methodGetSupportedLanguageTypes
Returns the language types supported by the device.
Public methodGetSupportedLightPathModes
Returns the light path modes supported by the device.
Public methodGetSupportedLightSourceModes
Returns the light source modes supported by the device.
Public methodGetSupportedMaxBatchBuffers
Returns the supported maximum batch buffers for the device.
Public methodGetSupportedNativeResolutions
Returns the native resolution values for the device.
Public methodGetSupportedNoiseFilterModes
Returns the noise filter modes supported by the device.
Public methodGetSupportedOrientationModes
Returns the orientation modes supported by the device.
Public methodGetSupportedOverscanModes
Returns the overscan modes supported by the device.
Public methodGetSupportedPatchCodes
Returns the patchcodes supported by the device.
Public methodGetSupportedPixelTypes
Returns the pixel types supported by the device.
Public methodGetSupportedPowerSupplies
Returns the supported power supplies for the device.
Public methodGetSupportedPrinterModes
Returns the printer modes supported by the device.
Public methodGetSupportedPrinters
Finds the type of imprinter or endorser supported by this device. These can be used to set which imprinter or endorser to use in the SetImprinterEndorser() method.
Public methodGetSupportedResolutions
Returns supported resolution values for the device.
Public methodGetSupportedRotations
Returns the rotations supported by the device.
Public methodGetSupportedScalingValues
Returns scaling values supported by the device.
Public methodGetSupportedShadowValues
Returns the shadow values supported by the device.
Public methodGetSupportedThresholdValues
Returns the threshold values supported by the device.
Public methodGetSupportedTransferMethods
Returns the transfer methods supported by the device.
Public methodGetSupportedUnitTypes
Returns the unit values supported by the device.
Public methodGetSupportedZoomFactors
Returns an array of valid zoom factors for this device.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLoadParameters
Loads previously saved device parameters into the device.
Public methodLoadXmlParameters
Load device parameter data saved with the SaveXmlParameters(Stream) method.
Public methodOpen

Opens a connection to this device.

You must open a connection to the device before getting or setting any device properties. If you don't need to get or set any properties, you can call the Acquire() method without using the Open or Close() methods.

TryOpen() is the preferred way to open a connection to the device.

Public methodPreFilterMessage
Filters out a message before it is dispatched.
Public methodCode exampleQueryCapability

Determines if a capability is available from the device.

It's unlikely that any one device supports all of the properties and features. You can use this method to find out if a property is get-able and/or set-able. This can also be used to help determine if the device is a camera by checking for camera specific properties, such as FlashUsed or BatteryPercentage.

Public methodSaveParameters
Saves the current device parameters to a stream.
Public methodSaveXmlParameters
Saves device property values into XML format.
Public methodSetCameraPixelOrder
Sets the pixel order for each enabled camera.
Public methodSetExtendedCapabilities
Sets the extended capabilities your application needs to negotiate during states 5 and 6 of a Twain session.
Public methodSetExtendedImageInfoOptions
Sets the extended image information options to obtain after acquiring the data.
Public methodSetFrames
Sets multiple frames to acquire from when scanning.
Public methodSetImageDataset

Sets the indices of the images you want to acquire.

This is useful when you want to acquire multiple images from a camera with a single call to the Acquire() method.

Public methodSetImprinterEndorser(ImprinterEndorserType, Boolean)
Use this method to enable or disable an imprinter or endorser.
Public methodSetImprinterEndorser(ImprinterEndorserType, ImprinterEndorserMode, String, Int32, String)
Use this method to enable an imprinter or endorser and set its parameters.
Public methodShowUserInterface

Displays the device interface.

This operation is used by applications that wish to display the device user interface to allow the user to manipulate the devices current settings for resolution, paper size, etc. but not acquire an image.

Public methodStartAutomaticCapture

Starts an automatic capture process.

This method does not acquire the images. Automatic capture implies that the device is capable of capturing images without the presence of the Application. This means that it must be possible for the Application to close the device and reopen it later, after the images have been captured.

Public methodToString
A string which describes this object.
(Overrides Object.ToString().)
Public methodCode exampleTryOpen

This method will attempt to open a connection to the device and will return true if it was successful. It's preferred to use this method instead of the Open() method.

The Close() method must be called when you are finished using the device.

Top
See Also