Jump to PiXCL Home page

Still Image logo FAQ: Still Image Devices explained.

Windows 98 introduced the concept of the Still Image device class, which includes scanners, digital cameras, multi-mode video cameras with still frame capture, and frame grabbers. Hence you now see many scanners such as the Epson 1200/1600 series that have a button on the scanner itself, so that once you place the document or photo on the scanner, all you have to do is press the button to start an image capture application. The same applies to a Still Image aware Digital Camera attached to your PC, when you press the shutter button to take a picture.

In Windows ME, Microsoft added Windows Image Acquisition (WIA) which is based on the Still Image libraries. Still Image and WIA are included in Windows XP.

Note: Still Image is not supported under Windows 95 or NT4 / 2000, and cannot be retro-installed.

Does Still Image / Windows Image Acquisition replace TWAIN ?

No, Still Image is provided in addition to TWAIN, and a properly written Still Image driver includes TWAIN support. TWAIN image acquisition is however now considered (by Microsoft) the obsolete or legacy way of acquiring an image, and is a so called "pull" method, that is, a TWAIN-aware imaging application must be running first, identifies an available device, and pulls the image into itself. Still Image is a so called "push" mode, such that the device pushes the image into an application, first starting it if it is not already running. Depending on how the application handles Still Image, a second instance of the application may be started.

Not all applications, esspecially older ones, are Still Image aware, but if they are TWAIN compatible, then your scanner or camera driver will usually be able to switch itself to TWAIN acquisition mode.

In Windows ME, Microsoft implemented their own c:\windows\twain_32.dll to link in with the WIA libraries, to create a TWAIN-compatibility mode of WIA. This very often causes all sorts of problems when people try to install older scanner drivers. The ME TWAIN -compatibility mode does not support TWAIN User Iinterface-off mode, so if you were running a scanner in this mode under Windows 9x/NT4, it won't run under ME without displaying the user interface.

 

What happens when I install a Still Image device?

Windows tracks the various drivers that get installed, and once a Still Image device driver has been installed, it activates (in Windows 98) the Cameras and Scanners Control Panel Applet (c:\windows\system\sticpl.cpl) . If you start the Control Panel, you should see the icon shown left. This is the applet that controls the various devices loaded. In Windows XP, sticpl.cpl does not exist, and has been replaced by the Scanners and Cameras special folder in the Control Panel.

 

Running the applet presents a dialog shown left. All loaded device names are presented here. This includes all Still Image aware scanners, digital cameras and frame grabbers.

When you select a device name and click Properties, another dialog appears that shows the functional parameters for that device.

 

If your device is for example a scanner, the various scanner events that can be generated are listed. Each event (which has an arbitrary name set by the manufacturer) has an action assigned to it, usually initially set by the scanner installation process.

For example, a recent model scanner that has a Start Scan button will send a START event, and this event will start an application that came bundled with the scanner.

Some scanners may implement more than one event, such as, say, TRANSPARENCY, that is an event from a transparency adapter. Another possibility is, say, HOPPER EMPTY, to indicate that a feeder mechanism needs to be refilled. Some devices also send ERROR events. In all cases, these events have the option of an application being started to handle the event. If no application is specified for the event, Windows ignores it.

A commonly asked question is "...how do I tell my scanner to start a different application than what was installed?". This is easy to fix: you need to register additional Still Image applications. When you installed the first device in your system, (generally) only one application was registered, so when the START event is received by Windows, it looks for the name of the application, finds one only and then starts it. You can of course unregister an application for a specific event.

You can Register multiple applications for a given event. For example, lets say you want to use App#1 for colour images and App#2 for grayscale images. When the scanner sends the event, Windows will present a dialog with the available registered application names with check boxes, and you select the one you need. Usually multiple applications will all be checked, but you can uncheck some or all if you want.

Registered application information is stored in the Registry.

When an application is registered with Still Image, the details get written to the Registry, and removed on an unregister operation. The Registry key in HKEY_LOCAL_MACHINE is

Software\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications

Note that your application needs to have Power User privileges to write HKEY_LOCAL_MACHINE but not to read it.

 

Still Image device support in FreePiXCL 4.48 and PiXCL 8.

PiXCL 8 has a command StillImageAdmin that is used to provide quick access to the Still Image application parameters.

 
Syntax: StillImageAdmin(INIT|INFO|REG|UNREG,AppName$,EventName$,Result)

Parameters:

INIT Initialializes the Still Image system, and makes the application Still Image aware. This is automatically undone when the PiXCL application exits.

INFO Used to check if the application was started by a Still Image event.

REG Register the Application and the EventName.

UNREG Unregister the Application and the EventName.

AppName$ The name of the application to be (un)registered, or the application that launched it. See Remarks below.

EventName$ The name of the event to be (un)registered, or the event that launched the application. See Remarks below.

Result 1 if the operation was successful, otherwise 0.

Remarks:

When an application is registered with Still Image, the details get written to the Registry, and removed on an unregister operation. The Registry key in HKEY_LOCAL_MACHINE is

Software\Microsoft\Windows\CurrentVersion\StillImage\Registered Applications

AppName$ becomes the key name e.g. MyImagingApp, and EventName$ becomes (say)

C:\Program Files\PiXCL6\Samples\ MyImagingApp.EXE . The registration process adds

/StiDevice:%1 /StiEvent:%2 to EventName$.

When an application has been started by a Still Image event, a call to StillImageAdmin with the INFO token returns EventName$ with a GUID (Globally Unique IDentifier), a number in the form “

{6bded1fc5-810f-11d0-bec7-08102be2092f}”, otherwise AppName$ and EventName$ are empty strings.

Using this command...

Suppose you have developed a PiXCL app that you want to be started when you press the scan button on your scanner. You will have compiled your application and stored it in a suitable directory. When Windows receives the START event, it will start up you PiXCL app, display the scanner User Interface (if it's not disabled) and acquire the image.

If you have FreePiXCL, you have to use a series of RDB* commands to access the Registry to read and write the relevent entries.

 


Copyright 2005-2008 Stewart DIBBS. All Rights Reserved.