Results 1 to 22 of 22

Thread: VB6 - WIA Scanning Demo

Threaded View

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    VB6 - WIA Scanning Demo

    Windows Image Acquisition (WIA) 2.0 is a great feature added in contemporary versions of Windows. It was an enhancement over the older WIA 1.0 that shipped with XP and Win2K.

    Windows Image Acquisition (WIA)

    The nice thing is that WIA 2.0 can be deployed to Windows XP SP1 or later as well:

    Windows® Image Acquisition Automation Library v2.0 Tool: Image acquisition and manipulation component for VB and scripting


    Because it is so new, it isn't documented in the MSDN Library CDs that came with VB6. The best source of documentation is a recent Windows SDK, such as:

    Microsoft® Windows® Software Development Kit Update for Windows Vista™

    Microsoft Windows SDK for Windows 7 and .NET Framework 4


    While WIA can be an easy way to do many types of image capture and processing in VB6 programs, the attached demo just shows a few of them:
    • Selecting a scanner.
    • Scanning a document.
    • Scaling an image.
    • Converting an image's format.
    • Displaying a WIA ImageFile object's contents.
    • Saving a WIA ImageFile object's contents to disk.

    Here we select a scanner, then we scan and scale/convert to JPEG, display the result, and optionally save the image to disk.


    There is also a menu in the demo that can be used to display/report various attributes of the selected scanner. The information can be useful to a developer though you wouldn't normally fetch it in a real application. However the logic used to fetch and report it may help reveal more about how some WIA objects work, so it is worth looking at.

    Similar reports can be created that extract things like Filter documentation from WIA objects.


    Note:

    Many older scanners do not come with a WIA driver, and only support the TWAIN API. These older scanners can't be used via WIA. Even some newer scanners don't expose full functionality via their WIA drivers, and may limit resolution and other properties.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by dilettante; Mar 28th, 2013 at 10:12 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width