I was assigned to create an image capture utility to work on the Windows platform. The spec is as follows: 1). The user should be able to see an onscreen “live-video-style” windows and click a capture button. 2). Advanced users may also want to import their pictures from their Super-Mega Pixel SLR type digital camera. OK can’t be too hard right? DirectX makes it all easy. I seem to forget that nothing is easy. After Marketing wavered a little in answering my question of what versions of Windows it would need to support, I went into research mode. Look at the standards I found:
VFW
Video for Windows, or VFW, is the multimedia technology that ships as part of Windows 95. It can be added to earlier versions of Windows when you install a CD-ROM title or other program that uses VFW. Its playback files have the extension .avi and can be played using Windows' Media Player. Since the files are large, they are often compressed using a codec. Video for Windows is no longer supported by Microsoft, and is being replaced by DirectShow/ActiveMovie (one of the DirectX technologies).
TWAIN
In Windows imaging applications, the most used API for scanning is TWAIN www.twain.org.
DirectX
ActiveMovie and DirectShow
DirectShow was known internally as Quartz during its development. The first release was ActiveMovie 1.0, released in July 1996. This provided an ActiveX control for media playback that supported playback of MPEG 1,AVI and QuickTime videos as well as audio files. There is an SDK that provides tools and information for developing filters and applications.
However, for the second release a year later, Microsoft renamed it to DirectShow to provide a more consistent naming scheme along with a re-organisation of the DirectX, ActiveAnimation and ActiveMovie development groups.
DirectShow is exposed as COM components and interfaces, at this two 'levels':
DirectShow custom interfaces - mainly for C++ programmers.
DirectShow VB components - designed for VB6, provides a type library.
WIA
WIA is a standardized Win32 API for acquiring digital images from devices that are primarily used to capture still images, and for managing these devices. WIA was introduced with Windows Millennium and updated for Windows XP. Today, most digital imaging devices are supported on XP by built-in or manufacturer provided WIA drivers.
The API is exposed as COM interfaces, in two flavors:
WIA custom interfaces - mainly for C++ programmers.
WIA Scripting Model - designed for scripting languagues and it provides a type library.
Of course .Net doesn’t support any of these. Fortunately the .Net community came to my rescue and I found many C# examples (see my .Net Tools Multimedia Section). I ended up supporting both Direct Show and Twain and that seem to satisfy most of the requirements but the pictures are not as high a quality as I would like.