Technology Without An Interesting Name
TWAIN is a program that lets you scan an image (using a scanner) directly into the application (such as PhotoShop, Photo Paint) where you want to work with the image. Without TWAIN, you would have to close an application that was open, open a special application to receive the image, and then move the image to the application where you wanted to work with it.
Within Delphi
Even though you could use some of the third-party components below, you already might have everything you need to scan an image from a Delphi application. The setup program for Imaging (tool that ships with Windows > 98) installs the Image Scan control (OCX) and the 32-bit TWAIN DLLs. All you have to do is to import this ActiveX control in Delphi and generate a component wrapper:

if ImgScan1.ScannerAvailable then
try
ImgScan1.OpenScanner;
ImgScan1.ScanTo := 2;
ImgScan1.Image:='c:\MyPicture.gif';
ImgScan1.StartScan ;
Application.ProcessMessages;
finally
ImgScan1.CloseScanner ;
end;
The rest of the code is yours to explore - there is an imgocxd.hlp help on the Kodak Imaging site.
No comments:
Post a Comment