TwainMBS class
Online Documentation - Statistics - FAQ - Plugin Parts (All, Dependencies) - Class hierarchy
New in Version
22.2
22.3
22.4
22.5
23.0
23.1
23.2
23.3
23.4
23.5
24.0
24.1
The list of the topics,
classes,
interfaces,
controls,
modules,
global methods by category,
global methods by name,
screenshots,
licenses
and examples.
Platforms to show: All Mac Windows Linux Cross-Platform
TwainMBS class
The plugin class for scanning with TWAIN compatible scanners.
Use is like this:
-
Declare subclass of TwainMBS so you can get events.
-
Create new instance of your subclass and store object in some window/app/module property.
-
For Windows call InstallEvent.
-
To scan, call Acquire method.
-
If driver runs synchronously, a modal window shows and you get back a picture object right away when scanning is done.
-
If driver runs asynchronously, it shows a non modal window and you receive events.
-
In TransferReady event you can call TransferImage method. In example a timer is triggered so this runs in the window.
-
To cleanup, use DisableDS and CloseDS methods.
-
We recommend only to have one instance of the TwainMBS object.
When Xojo or Xojo is used (32 bit), we can of course only see and use devices with 32 bit drivers.
Once Xojo will be ported to 64bit, we can only talk to 64bit drivers.
For 64-bit on Windows you can find 64-bit TwainDSM.dll here:
https://github.com/twain/twain-dsm
- 5 events
- event CloseRequest
- event TransferEnded(pic as picture, ImageInfo as TwainImageInfoMBS, sliced as boolean, layout as TwainImageLayoutMBS)
- event TransferProgress(percent as Double, dataRead as Int64, DataSize as Int64, ImageInfo as TwainImageInfoMBS, NewDataSize as Integer, NewData as Memoryblock, NewPicture as Picture, layout as TwainImageLayoutMBS, Columns as Integer, Rows as Integer, XOffset as Integer, YOffset as Integer)
- event TransferReady
- event TransferStarted(DataSize as Int64, ImageInfo as TwainImageInfoMBS, layout as TwainImageLayoutMBS) as boolean
- 24 properties
- 28 methods
- method Acquire(modal as boolean = false, showUI as boolean = true) as picture
- method AllDevices as TwainIdentityMBS()
- method AppIdentity as TwainIdentityMBS
- method CanBW as boolean
- method CanGray as boolean
- method CanPalette as boolean
- method CanRGB as boolean
- method CloseDS
- method CloseDSM
- method Constructor(Country as Integer, Language as Integer)
- method DisableDS
- method DontUnload
- method DSIdentity as TwainIdentityMBS
- method GetEnumerationCapability(ID as Integer, byref ItemType as Integer, byref Count as Integer, byref CurrentIndex as Integer, byref DefaultIndex as Integer) as Integer()
- method GetIntegerCapability(ID as Integer, byref Type as Integer) as Integer
- method ImageInfo as TwainImageInfoMBS
- method IsDSEnabled as boolean
- method OpenDS
- method OpenDSM
- method ProcessEvents
- method SelectDS
- method SelectDS(device as TwainIdentityMBS)
- method SetBoolCapability(ID as Integer, Value as Boolean)
- method SetFloatCapability(ID as Integer, Value as Double)
- method SetInt32Capability(ID as Integer, Value as Int32)
- method SetUInt16Capability(ID as Integer, Value as UInt16)
- method SupportsMemoryTransfer as boolean
- method TransferImage as picture
- 387 constants
This class has no sub classes.
Some examples using this class:
Blog Entries
Release notes
- Version 22.0
- Changed window properties to variant, so you can use DesktopWindow there for WindowsShortCutMBS, WindowsPrintDialogMBS, WindowsPageSetupDialogMBS, WindowsICMSetupMBS, WindowsBlueToothSelectDeviceDialogMBS, TwainMBS, TaskDialogMBS, OpenDialogMBS, DirectShowVideoWindowMBS, WindowsStoreContextMBS, WindowsFileCopyMBS, WindowsFontDialogMBS, WindowsPreviewHandlerMBS, WindowsStoreContextMBS, ParentChromiumFrameMBS and ChromiumBrowserMBS classes.
The items on this page are in the following plugins: MBS Picture Plugin.
TwainImageLayoutMBS
-
TwainVersionMBS