Acquiring Images

After an image has been selected, an application uses the IWiaDataTransfer interface (for applications running in Windows XP or earlier) or the IWiaTransfer interface (for applications running in Windows Vista or later) to transfer image data from imaging devices. See either Transfering Image Data in WIA 1.0 or Transferring Image Data in WIA 2.0 for details.

After a device has been selected, an application uses the IWiaItem::DeviceDlg method of the IWiaItem or IWiaItem2 interface of the device (the root item) to select an image from a specified Windows Image Acquisition (WIA) device. The IWiaDevMgr::GetImageDlg method displays a dialog box that allows a user to select an image from a specified device, and transfers the image to a file name selected by the user. It also allows the user to specify a device if necessary. For more information, see Selecting a Device

Note that it is not necessary for a user to select an image using the above method. An application can obtain a pointer to an image item directly from a device's item tree. For instructions, see Navigating an Item Tree.

Once the WIA item that represents the desired image has been selected, an application running on Windows XP or earlier queries the IWiaItem interface of that item for a pointer to its IWiaDataTransfer interface. An application running on Windows Vista or later queries the IWiaItem2 interface for a pointer to its IWiaTransfer interface.

The application can then uses the methods of the IWiaDataTransfer (or IWiaTransfer) interface to transfer the image data to the application.

If the imaging device is a scanner, IWiaDataTransfer::idtGetData, or other methods of the IWiaDataTransfer interface, triggers a scan operation, and then transfers the resulting image data. If the device is a camera, the image data is simply transferred from the camera to the application.