Difference between revisions of "Scanner csharp"
Line 1: | Line 1: | ||
==Програмен достъп до скенер== | ==Програмен достъп до скенер== | ||
===TWAIN=== | ===TWAIN=== | ||
− | TWAIN е програмен интерфейс (API) и комуникционен протокол за управление на комуникацията между софтуeрни приложения и устройства за въвеждане на графична информация ( | + | TWAIN е програмен интерфейс (API) и комуникционен протокол за управление на комуникацията между софтуeрни приложения и устройства за въвеждане на графична информация ( изображения от скенери, цифрови фотопарати и др.) |
− | |||
TWAIN се разработва от [http://www.twain.org TWAIN Working Group] с цел: | TWAIN се разработва от [http://www.twain.org TWAIN Working Group] с цел: | ||
Line 11: | Line 10: | ||
*и др. | *и др. | ||
− | ===WIA=== | + | |
+ | === Windows Image Acquisition (WIA)=== | ||
+ | |||
Revision as of 12:09, 4 May 2015
Contents
Програмен достъп до скенер
TWAIN
TWAIN е програмен интерфейс (API) и комуникционен протокол за управление на комуникацията между софтуeрни приложения и устройства за въвеждане на графична информация ( изображения от скенери, цифрови фотопарати и др.)
TWAIN се разработва от TWAIN Working Group с цел:
- Осигуряване на съвместимост между графичен софтуер и хардуер
- Многоплатформена поддръжка (примерно Windows, Mac OS, and Linux)
- Безплатна поддръжка и разпространение на инструменти за разработчици
- Насърчаване на употребата на TWAIN
- и др.
Windows Image Acquisition (WIA)
Windows Image Acquisition (WIA; sometimes also called Windows Imaging Architecture) is a proprietary Microsoft driver model and application programming interface (API) for Microsoft Windows Me and later Windows operating systems that enables graphics software to communicate with imaging hardware such as scanners, digital cameras and Digital Video-equipment. It was first introduced in 2000 as part of Windows Me, and continues to be the standard imaging device and API model through successive Windows versions. It is implemented as an on-demand service in Windows XP and later Windows operating systems.[1]
Contents
1 Overview 2 Additional information 3 Applications that use WIA 4 See also 5 References 6 External links
Overview
WIA is a very significant superset of the support for digital still imaging drivers that was provided by the Still Image Architecture (STI) in Windows 98. Whereas STI only provided a low-level interface for doing basic transfers of data to and from the device (as well as the invocation of an image scan process on the Windows machine through the external device), WIA provides a framework through which a device can present its unique capabilities to the operating system, and applications can invoke those features. According to Microsoft, WIA drivers are made up of a user interface (UI) component and a driver core component, loaded into two different process spaces: UI in the application space and the driver core in the WIA service space.
Many scanners support WIA.[2][3][citation needed] Additional information
In 2002, Microsoft released the Windows Image Acquisition Automation Library Tool, which provides access to WIA functionality through programming languages and scripting environments that support OLE Automation.
In Windows XP, WIA runs in the LocalSystem context. Because of the security ramifications of running a service as LocalSystem whereby a buggy driver or malicious person would have unrestricted access to the system, the WIA service in Windows Server 2003 and Windows Vista operates in the LocalService context. This can result in compatibility issues when using a driver designed for Windows XP.[4]
In Windows XP, support was added for automatic document feeder scanners, scroll-feed scanners without preview capabilities and multi-page TIFF generation.[5] For WIA video, a snapshot filter driver is introduced that allows still frames to be captured from the video stream.
Windows Vista has the WIA Automation library built-in. Also, WIA supports push scanning and multi-image scanning. Push scanning allows initiating scans and adjusting scanning parameters directly from the scanner control panel. Multi-image scanning allows one to scan several images at once and save them directly as separate files. However, video content support is removed from WIA for Windows Vista.[6] Microsoft recommends using the newer Windows Portable Devices API.[citation needed]
Scanner Access Now Easy (SANE)
xxx
// _twain // this.components = new System.ComponentModel.Container(); this.twain = new Saraff.Twain.Twain32(this.components); this.twain.AppProductName = "Saraff.Twain, Version=1.0.0.0"; this.twain.Parent = this; this.twain.AcquireCompleted += new System.EventHandler(this.getScan);
private Saraff.Twain.Twain32 twain;
private void scanner_Click(object sender, EventArgs e) { this.twain.CloseDataSource(); this.twain.SelectSource(); }
private void scanButton_Click(object sender, EventArgs e) { this.twain.Acquire(); }
private void getScan(object sender, EventArgs e) { if ( twain.ImageCount > 0) { pictureBox1.Image = twain.GetImage(0); } }