Windows Image Acquisition Automation Layerを使うと、VBScriptや(古い)Visual BasicからWIAデバイスを制御することができます。 WIAを操作するVBScriptはHTMLに組み込むこともできます。
Automation LayerのオブジェクトのguidHTMLから(VBScriptを使って)Automation Layerのオブジェクトを作るときにobjectタグのclassid属性でAutomation Layerのオブジェクトのguidを指定する必要があります。DeviceManager, CommonDialog, VideoPreview等のオブジェクトについてはWIA Automation Libraryに同梱されているサンプルやmsdnのドキュメントにguidが記載されていますが、それ以外のオブジェクトのguidについては説明がありません。以下はOLE-DLL Viewe調べたAutomation Layerのオブジェクトのguid値です。以下の表で「path」の項目はOLE-DLL Vieweで表示される位置を意味します。
CommonDialog | |
guid | 850D1D11-70F3-4BE5-9A11-77AA6B2BB201 |
path | 「Grouped by Component Category」 -「Automation Objects」 -「CommonDialog Class」 |
DeviceManager | |
guid | E1C5D730-7E97-4D8A-9E42-BBAE87C2059F |
path | 「Grouped by Component Category」 -「Automation Objects」 -「DeviceManager Class」 |
ImagePocess | |
guid | BD0D38E4-74C8-4904-9B5A-269F8E9994E9 |
path | 「Grouped by Component Category」 -「Automation Objects」 -「ImagePocess Class」 |
Rational | |
guid | 0C5672F9-3EDC-4B24-95B5-a6C54C0B79AD |
path | Grouped by Component Category」 -「Automation Objects」 -「Rational Class」 |
Vector | |
guid | 4DD1D1C3-B36A-4EB4-AAEF-815891A58A30 |
path | 「Grouped by Component Category」 -「Automation Objects」 -「Vector Class」 |
VideoPreview | |
guid | 0B5F2CC8-5E1E-44F9-899B-3B789705AFCA |
path | 「Grouped by Component Category」 -「Automation Objects」 -「VideoPreview Class」 |
WIA Automation Layerを操作するアプリケーションの開発環境について、msdnのhttp://msdn.microsoft.com/en-us/library/ms630818(v=VS.85).aspxが参考になります。WIA Automation Layerは以下の環境から操作することができます。
WIA Automation Layerを操作するには(基本的に?)Windows Image Acquisition Automation Libraryが必要になります。(2010.7.21時点で)最新バージョンとして2.0がリリースされていますが、これはService Pack 1を適用したWindows XPのみで使えます。それ以降のOSのサポートが気になりますが、Windows Vista以降は組み込みのWIAオートメーションライブラリを持っているようですのでWindows Image Acquisition Automation LibraryがなくてもWIAを操作できると思われます。WIA Automation Libraryのインストールは同梱されているドキュメントに従えば特に戸惑うことも無くインストールに成功すると思います。
Windows XP環境では、WIA Automation Libraryを使うことで、WIA Automation Layerの機能を利用できるようです。 ただし、このライブラリのドキュメントで説明されているVisual Basicのバージョンは6.0で.NET対応以降のバージョンのVisual Basicでは利用できないようです。
Windows XP環境では、WIA Automation LibraryをインストールすればVBScriptからWIA Automation Layerを操作できることが確認できました。ライブラリに同梱されているHTML+VBScriptのアプリケーションがそのままIE上で動作しました。