Platforms to show: All Mac Windows Linux Cross-Platform
Back to TwainMBS class.
TwainMBS.Acquire(modal as boolean = false, showUI as boolean = true) as picture
Function:
Acquires a new picture.
Notes:
Lasterror is set.
Plugin asks for asynchronously operation, so this function returns nil and success in lasterror.
If data source must be used with modal UI, this function returns with picture.
Modal can be true to ask for modal dialog. Seems to be only supported on Mac.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Lasterror is set.
Plugin asks for asynchronously operation, so this function returns nil and success in lasterror.
If data source must be used with modal UI, this function returns with picture.
Modal can be true to ask for modal dialog. Seems to be only supported on Mac.
TwainMBS.AllDevices as TwainIdentityMBS()
Function:
Returns array with all devices.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim twain as TwainMBS // your twain object
dim devices() as TwainIdentityMBS = twain.AllDevices
dim found as Boolean
dim NameToFind as string = "MyScanner123"
for each device as TwainIdentityMBS in devices
if device.ProductName = NameToFind then
found = true
// lets use this one
twain.SelectDS(device)
if twain.Lasterror <> 0 then
MsgBox "Failed to select "+device.ProductName
else
'MsgBox "OK"
exit
end if
end if
next
if not found then
MsgBox "No scanner found named: "+NameToFind
end if
TwainMBS.AppIdentity as TwainIdentityMBS
Function:
Queries app identity.
Notes: That's the identity the plugin used to register with twain library.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: That's the identity the plugin used to register with twain library.
TwainMBS.CanBW as boolean
Function:
Whether device supports black and white pixel type.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.CanGray as boolean
Function:
Whether device supports gray pixel type.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.CanPalette as boolean
Function:
Whether current device supports palette pixel type.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.CanRGB as boolean
Function:
Whether current device supports RGB pixel type.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.CloseDS
Function:
Close data source.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
Some examples using this method:
TwainMBS.CloseDSM
Function:
Closes the data source manager.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.Constructor(Country as Integer, Language as Integer)
Function:
Initializes Twain engine with given localization.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.DefaultDevice as TwainIdentityMBS
Function:
The default device.
Notes: (Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: (Read and Write computed property)
Some examples using this property:
TwainMBS.DisableDS
Function:
Diables data source.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
Some examples using this method:
TwainMBS.DontUnload
Function:
Informs the plugin to not unload the twain library.
Notes: This avoids a crash for some people.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.5 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: This avoids a crash for some people.
TwainMBS.DSIdentity as TwainIdentityMBS
Function:
Queries the details on the data source.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
Some examples using this method:
TwainMBS.GetEnumerationCapability(ID as Integer, byref ItemType as Integer, byref Count as Integer, byref CurrentIndex as Integer, byref DefaultIndex as Integer) as Integer()
Function:
Queries an enum capability.
Example:
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
This should work fine for all integer enum types like boolean, 8, 16 or 32 bit integers.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim t as TwainMBS // your twain object
// check supported sizes
const ICAP_SUPPORTEDSIZES = &h1122
dim type5 as Integer
dim EnumCount as Integer = 0
dim EnumItemType as Integer = 0
dim EnumCurrentIndex as Integer = 0
dim EnumDefaultIndex as Integer = 0
dim EnumValues() as Integer = t.GetEnumerationCapability(ICAP_SUPPORTEDSIZES, EnumItemType, EnumCount, EnumCurrentIndex, EnumDefaultIndex)
dim e5 as Integer = t.Lasterror
dim c5 as Integer = t.ConditionCode
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
This should work fine for all integer enum types like boolean, 8, 16 or 32 bit integers.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.GetIntegerCapability(ID as Integer, byref Type as Integer) as Integer
Function:
Queries an integer capability.
Example:
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
This should work fine for all integer types like boolean, 8, 16 or 32 bit integers.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim t as TwainMBS // your twain object
t.OpenDS
if t.Lasterror <> 0 then
MsgBox "Failed to open device: "+str(t.Lasterror)
Return
end if
const CAP_FEEDERENABLED = &h1002
const CAP_FEEDERLOADED = &h1003
const TWRC_FAILURE = 1
const TWCC_CAPUNSUPPORTED = 13
// query before
dim type1 as Integer
dim n1 as Integer = t.GetIntegerCapability(CAP_FEEDERENABLED, type1)
dim e1 as Integer = t.Lasterror
dim c1 as Integer = t.ConditionCode
// set on
t.SetBoolCapability CAP_FEEDERENABLED, true
dim e2 as Integer = t.Lasterror
dim c2 as Integer = t.ConditionCode
// query after
dim type3 as Integer
dim n3 as Integer = t.GetIntegerCapability(CAP_FEEDERENABLED, type3)
dim e3 as Integer = t.Lasterror
dim c3 as Integer = t.ConditionCode
// now query loaded?
dim type4 as Integer
dim n4 as Integer = t.GetIntegerCapability(CAP_FEEDERLOADED, type4)
dim e4 as Integer = t.Lasterror
dim c4 as Integer = t.ConditionCode
if e4 = TWRC_FAILURE AND c4 = TWCC_CAPUNSUPPORTED then
// not supported!
Break
end if
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
This should work fine for all integer types like boolean, 8, 16 or 32 bit integers.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.ImageInfo as TwainImageInfoMBS
Function:
Queries information about current image.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.Imagelayout as TwainImageLayoutMBS
Function:
Get/Set the image layout.
Notes:
Lasterror is set. DataSource must be open.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Lasterror is set. DataSource must be open.
(Read and Write computed property)
TwainMBS.IsDSEnabled as boolean
Function:
Whether data source is enabled.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
TwainMBS.OpenDS
Function:
Opens the data source.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
TwainMBS.OpenDSM
Function:
Opens Data source Manager.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
TwainMBS.ProcessEvents
Function:
Process events in plugin.
Notes:
Only for Windows needed for some Twain drivers. You call it after you run Acquire to let the plugin wait for the events to start the transfer.
When transfer is ready or dialog is cancelled, this method ends.
On Mac OS X or Linux this method does nothing so it's no problem calling it.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Only for Windows needed for some Twain drivers. You call it after you run Acquire to let the plugin wait for the events to start the transfer.
When transfer is ready or dialog is cancelled, this method ends.
On Mac OS X or Linux this method does nothing so it's no problem calling it.
Some examples using this method:
TwainMBS.SelectDS
Function:
Queries dialog to ask the user to select a data source.
Notes: Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Lasterror is set.
See also:
Some examples using this method:
TwainMBS.SelectDS(device as TwainIdentityMBS)
Function:
Selects the given device without dialog.
Example:
Notes:
Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim twain as TwainMBS // your twain object
dim devices() as TwainIdentityMBS = twain.AllDevices
dim found as Boolean
dim NameToFind as string = "MyScanner123"
for each device as TwainIdentityMBS in devices
if device.ProductName = NameToFind then
found = true
// lets use this one
twain.SelectDS(device)
if twain.Lasterror <> 0 then
MsgBox "Failed to select "+device.ProductName
else
'MsgBox "OK"
exit
end if
end if
next
if not found then
MsgBox "No scanner found named: "+NameToFind
end if
See also:
TwainMBS.SetBoolCapability(ID as Integer, Value as Boolean)
Function:
Sets a capability with boolean.
Example:
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a boolean.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Example:
dim t as TwainMBS // your twain object
t.OpenDS
if t.Lasterror <> 0 then
MsgBox "Failed to open device: "+str(t.Lasterror)
Return
end if
const CAP_FEEDERENABLED = &h1002
const CAP_FEEDERLOADED = &h1003
const TWRC_FAILURE = 1
const TWCC_CAPUNSUPPORTED = 13
// query before
dim type1 as Integer
dim n1 as Integer = t.GetIntegerCapability(CAP_FEEDERENABLED, type1)
dim e1 as Integer = t.Lasterror
dim c1 as Integer = t.ConditionCode
// set on
t.SetBoolCapability CAP_FEEDERENABLED, true
dim e2 as Integer = t.Lasterror
dim c2 as Integer = t.ConditionCode
// query after
dim type3 as Integer
dim n3 as Integer = t.GetIntegerCapability(CAP_FEEDERENABLED, type3)
dim e3 as Integer = t.Lasterror
dim c3 as Integer = t.ConditionCode
// now query loaded?
dim type4 as Integer
dim n4 as Integer = t.GetIntegerCapability(CAP_FEEDERLOADED, type4)
dim e4 as Integer = t.Lasterror
dim c4 as Integer = t.ConditionCode
if e4 = TWRC_FAILURE AND c4 = TWCC_CAPUNSUPPORTED then
// not supported!
Break
end if
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a boolean.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.SetFloatCapability(ID as Integer, Value as Double)
Function:
Sets a capability with floating point value.
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a floating point value (FIX32).
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a floating point value (FIX32).
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.SetInt32Capability(ID as Integer, Value as Int32)
Function:
Sets a capability with 32 bit integer.
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a 32 bit integer.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a 32 bit integer.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.SetUInt16Capability(ID as Integer, Value as UInt16)
Function:
Sets a capability with 16 bit integer.
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a 16 bit integer.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 15.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
Please review Twain Documentation for details.
Please open data source before via OpenDS method.
You may see problems if you use this method on a capability which is not a 16 bit integer.
Sets lasterror and condition code.
(if lasterror is 1 and condition code is 13, the capability is not supported)
TwainMBS.SupportsMemoryTransfer as boolean
Function:
Whether the twain data source supports memory transfers.
Notes: As our plugin uses only memory transfers, the source must support this in order to work with our plugin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Twain | MBS Picture Plugin | 12.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: As our plugin uses only memory transfers, the source must support this in order to work with our plugin.
The items on this page are in the following plugins: MBS Picture Plugin.
