Platforms to show: All Mac Windows Linux Cross-Platform

Back to WIAItemMBS class.

WIAItemMBS.AnalyzeItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The AnalyzeItem method causes the Windows Image Acquisition (WIA) hardware device to acquire and try to detect what data types are present.

This method is used with scanners to detect what type of data is on a page. When an application calls this method, the WIA hardware device driver scans and analyzes the current page. For each data type it detects, it creates an WiaItem object to represent the region on the page the data occupies.

Image processing and OCR software can use this capability to detect graphics and text on a page. This method adds the regions it creates into the WIA device's WiaItem tree. The application can select the individual regions and use the standard data transfer methods to acquire data from them.

If necessary, applications can override the regions created by this method.

Works only on WIA 1.x.
Lasterror is set.

WIAItemMBS.CreateChildItem(ItemFlags as Integer, CreationFlags as Integer, ItemName as string, FullItemName as string) as WIAItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The CreateChildItem method is used by applications to add WiaItem objects to the WiaItem tree of a device.

ItemFlags: Specifies the WIA item type.
CreationFlags: Specifies how to create the new item. Only for WIA 2.x. Can be 0 to set the default values for the properties of the child. Can be &H40000000 to copy the values of all Read/Write properties from the parent.
ItemName: Specifies the WIA item name, such as "Top". You can think of this parameter as being equivalent to a file name.
FullItemName: Specifies the full WIA item name. You can think of this parameter as equivalent to a full path to a file, such as "003\Root\Top". Only for WIA 1.x.

Lasterror is set.
Returns nil on any error and the new item object on success.

Some WIA hardware devices allow applications to create new items in the WiaItem tree that represents the device. Applications must test the devices to see if they support this capability. Use the EnumerateDeviceCapabilities function to enumerate the current device's capabilities.

If the device allows the creation of new items in the WiaItem tree, invoking CreateChildItem creates a new WiaItem that is a child of the current node.

WIAItemMBS.DataTransfer as WIADataTransferMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a Data transfer object.

Lasterror is set.
Only for WIA 1.x.
Returns nil on any error.

Some examples using this method:

WIAItemMBS.DeleteItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Removes the current IWiaItem object from the object tree of the device.

Lasterror is set.
Available on both WIA 1.x and 2.x.

The Windows Image Acquisition (WIA) run-time system represents each WIA hardware device connected to the user's computer as a hierarchical tree of IWiaItem objects. A given WIA device may or may not allow applications to delete IWiaItem objects from its tree. Use the EnumerateDeviceCapabilities function to query the device for item deletion capability.

If the device supports item deletion in its WiaItem tree, invoke the DeleteItem method to remove the WiaItem object. Note that this method will only delete an object after all references to the object have been released.

WIAItemMBS.DeviceCommand(command as WIAGUIDMBS) as WIAItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Issues a command to a Windows Image Acquisition (WIA) hardware device.
Example
dim targetItem as WIAItemMBS // your item
dim resultItem as WIAItemMBS
resultItem = targetItem.DeviceCommand(targetItem.kCommandTakePicture)

Command: Specifies the command to send to the WIA 2.0 device. See kCommand* constants.
Works with WIA 1.x and 2.x.

Applications use this method to send WIA commands to hardware devices.

When the application sends the kCommandTakePicture command to the device, the WIA run-time system creates the WiaItem object to represent the image. The DeviceCommand method returns this new WIAItemMBS object.

Some examples using this method:

WIAItemMBS.DeviceDialog(Flags as integer, Win as DesktopWindow, FolderName as string, Filename as string, paths() as string, items() as WIAItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 22.0 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Displays a dialog box to the user to prepare for image acquisition.

Lasterror is set.
Only for WIA 2.x.

Flags: Specifies a set of flags that control the dialog box's operation. The value can be either 0 to represent the default behavior or any of the following flags: kDeviceDialogSingleImage, kDeviceDialogUseCommonUI and kSelectDeviceNoDefault
Win: A handle to the parent window.
FolderName: Specifies the folder name where the files are to be transferred.
Filename: Specifies the template file name.
paths: An array to be filled with the file paths.
items: An array to be filled with the wia item objects.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. It is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaTransferMBS class to acquire the image.

See also:

WIAItemMBS.DeviceDialog(Flags as Integer, Win as window, FolderName as string, Filename as string, paths() as string, items() as WIAItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Displays a dialog box to the user to prepare for image acquisition.

Lasterror is set.
Only for WIA 2.x.

Flags: Specifies a set of flags that control the dialog box's operation. The value can be either 0 to represent the default behavior or any of the following flags: kDeviceDialogSingleImage, kDeviceDialogUseCommonUI and kSelectDeviceNoDefault
Win: A handle to the parent window.
FolderName: Specifies the folder name where the files are to be transferred.
Filename: Specifies the template file name.
paths: An array to be filled with the file paths.
items: An array to be filled with the wia item objects.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. It is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaTransferMBS class to acquire the image.

See also:

WIAItemMBS.DeviceDialog(Flags as Integer, WindowHandle as Integer, FolderName as string, Filename as string, paths() as string, items() as WIAItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Displays a dialog box to the user to prepare for image acquisition.

Lasterror is set.
Only for WIA 2.x.

Flags: Specifies a set of flags that control the dialog box's operation. The value can be either 0 to represent the default behavior or any of the following flags: kDeviceDialogSingleImage, kDeviceDialogUseCommonUI and kSelectDeviceNoDefault
WindowHandle: A handle to the parent window.
FolderName: Specifies the folder name where the files are to be transferred.
Filename: Specifies the template file name.
paths: An array to be filled with the file paths.
items: An array to be filled with the wia item objects.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. It is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaTransferMBS class to acquire the image.

See also:

WIAItemMBS.DeviceDialog(Win as DesktopWindow, Flags as integer, Intent as integer) as WIAItemMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 22.0 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The DeviceDialog method is used by applications to display a dialog box to the user to prepare for image acquisition.

win: Handle of the parent window of the dialog box.
Flags: Specifies a set of flags that control the dialog box's operation. Can be set to any of the following values: kDeviceDialogUseCommonUI and kDeviceDialogSingleImage.
Intent: Specifies what type of data the image is intended to represent. For a list of image intent values, kIntent* constants.

Lasterror is set.
Only for WIA 1.x.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. For instance, this dialog box enables the user to select images to download from a camera. When using a scanner, it is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaDataTransferMBS interface to acquire the image.

It is recommended that applications make device and image selection available through a menu item named From scanner or camera on the File menu.

See also:

WIAItemMBS.DeviceDialog(Win as window, Flags as Integer, Intent as Integer) as WIAItemMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The DeviceDialog method is used by applications to display a dialog box to the user to prepare for image acquisition.

win: Handle of the parent window of the dialog box.
Flags: Specifies a set of flags that control the dialog box's operation. Can be set to any of the following values: kDeviceDialogUseCommonUI and kDeviceDialogSingleImage.
Intent: Specifies what type of data the image is intended to represent. For a list of image intent values, kIntent* constants.

Lasterror is set.
Only for WIA 1.x.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. For instance, this dialog box enables the user to select images to download from a camera. When using a scanner, it is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaDataTransferMBS interface to acquire the image.

It is recommended that applications make device and image selection available through a menu item named From scanner or camera on the File menu.

See also:

WIAItemMBS.DeviceDialog(WindowHandle as Integer, Flags as Integer, Intent as Integer) as WIAItemMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The DeviceDialog method is used by applications to display a dialog box to the user to prepare for image acquisition.

WindowHandle: Handle of the parent window of the dialog box.
Flags: Specifies a set of flags that control the dialog box's operation. Can be set to any of the following values: kDeviceDialogUseCommonUI and kDeviceDialogSingleImage.
Intent: Specifies what type of data the image is intended to represent. For a list of image intent values, kIntent* constants.

Lasterror is set.
Only for WIA 1.x.

This method displays a dialog box to the user that an application uses to gather all the information required for image acquisition. For instance, this dialog box enables the user to select images to download from a camera. When using a scanner, it is also used to specify image scan properties such as brightness and contrast.

After this method returns, the application can use the WiaDataTransferMBS interface to acquire the image.

It is recommended that applications make device and image selection available through a menu item named From scanner or camera on the File menu.

See also:

WIAItemMBS.EnumerateChildItems(CategoryGUID as WIAGUIDMBS=nil) as WIAItemEnumeratorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates and returns an enumerator object for non-empty folders in a WiaItem tree of a Windows Image Acquisition (WIA) device.
Example
Sub EnumerateItems(root as WIAItemMBS)
dim e as WIAItemEnumeratorMBS = Root.EnumerateChildItems

if e<>Nil then
dim it as WIAItemMBS = e.NextItem

while it<>nil

// do something with item

it = e.NextItem
wend

end if
End Sub

Lasterror is set.
Works for WIA 1.x and WIA 2.x.

CategoryGUID: Specifies a category for which child nodes are enumerated. If nil, then all child nodes are enumerated. This parameter is only used on WIA 2.x.

The WIA run-time system represents each WIA hardware device as a hierarchical tree of WiaItem objects. The EnumerateChildItems method enables applications to enumerate child items in the current item. However, it can only be applied to items that are folders.

If the folder is not empty, it contains a subtree of WiaItem objects. The EnumerateChildItems method enumerates all of the items contained in the folder.

Some examples using this method:

WIAItemMBS.EnumerateDeviceCapabilities(Flags as Integer) as WIADeviceCapabilitiesEnumeratorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates an enumerator that is used to ascertain the commands and events a Windows Image Acquisition (WIA) device supports.

Flags: Specifies a flag that selects the type of capabilities to enumerate. Can be a combination of kDeviceCommands and kDeviceEvents.

Works for both WIA 1.x and 2.x
Lasterror is set.

Use this method to create an enumerator object to obtain the set of commands and events that a WIA device supports. You can use the Flags parameter to specify which kinds of device capabilities to enumerate.

WIAItemMBS.FindItemByName(name as string) as WIAItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Searches an item's tree of subitems using the name as the search key.

name: Specifies the name fo the item to search for.

Lasterror is set.
Works with WIA 1.x and 2.x.

This method searches the current item's tree of sub-items using the name as the search key. If FindItemByName finds the item specified by name, it retruns the WiaItem object.

WIAItemMBS.ItemCategory as WIAGUIDMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Gets an item's category information.

Lasterror is set. Only for WIA 2.x.

Every WiaItemMBS object in the hierarchical tree of objects associated with a Windows Image Acquisition (WIA) 2.0 hardware device has a specific category. This method enables applications to identify the category of any item in a hierarchical tree of item objects in a device.

Requires Windows Vista or Windows Server 2008.

WIAItemMBS.ItemType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Gets an item's type information.
Example
dim it as WIAItemMBS // your item
if BitwiseAnd(it.ItemType,it.kTypeFolder)=it.kTypeFolder or BitwiseAnd(it.ItemType, it.kTypeHasAttachments)=it.kTypeHasAttachments then
msgbox "may have children."
else
msgbox "no children."
end if

Works with WIA 1.x and 2.x.
Lasterror is set.

Every WiaItemMBS object in the hierarchical tree of objects associated with a Windows Image Acquisition (WIA) 2.0 hardware device has a specific data type. Item objects represent folders and files. Folders contain file objects. File objects contain data acquired by the device such as images and sounds. This method enables applications to identify the type of any item in a hierarchical tree of item objects in a device.

An item may have more than one type. For example, an item that represents an audio file will have the type attributes WiaItemTypeAudio bitwiseor WiaItemTypeFile.

Some examples using this method:

WIAItemMBS.ParentItem as WIAItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Gets the parent item in the tree that represents a Windows Image Acquisition (WIA) 2.0 hardware device.

Works only in WIA 2.x. Lasterror is set.
Given any WiaItem object in the object tree of a WIA 2.0 hardware device, the application retrieves a pointer to the parent item by calling this function.

WIAItemMBS.PropertyStorage as WIAPropertyStorageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries properties for this item.
Example
Sub ListProperties(it as WIAItemMBS, plist as listbox)
// enumerate properties into a given listbox

// clear list
PList.DeleteAllRows

// get properties
dim p as WIAPropertyStorageMBS = it.PropertyStorage
if p<>Nil then
dim e as WIAPropertyEnumeratorMBS = p.Enumerate

if e<>nil then
dim ps as WIAPropertyMBS = e.NextItem

while ps<>Nil
// read the property value
dim v as Variant = p.Read(ps)

// get some identifier string for the listbox, name or id
dim k as string = ps.Name
if len(k)=0 then
k = str(ps.ID)
end if

PList.AddRow k

if v.Type = v.TypeObject then
if v isa WIAGUIDMBS then
dim g as WIAGUIDMBS = v
PList.Cell(PList.LastIndex,1)=g.DisplayString
else
PList.Cell(PList.LastIndex,1)="? some object" // should never happen
end if
else
PList.Cell(PList.LastIndex,1)=v.StringValue
end if

ps = e.NextItem
wend

end if
end if
End Sub

Lasterror is set.
Returns nil on any error.

Some examples using this method:

WIAItemMBS.RootItem as WIAItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the root item of a tree of item objects used to represent a Windows Image Acquisition (WIA) hardware device.

Lasterror is set.
Works with WIA 1.x and 2.x.

Given any WiaItem object in the object tree of a WIA hardware device, the application retrieves a pointer to the root item by calling this function.

WIAItemMBS.Transfer as WIATransferMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a transfer object for this item.

Only available on WIA 2.x.
Lasterror is set.
Returns nil on any error.

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...