whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

71 Visitors Online


 
...scan an image directly into the application?
Autor: Ronald Rethfeldt (RoGaSoft)
Homepage: http://www.rogasoft.de
[ Print tip ]  

Tip Rating (9):  
     




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:

Import the ActiveX Control "Kodak Image Scan Control"
(Select Component|Import ActiveX Control...)

Now add a TImgScan Component from the Register "ActiveX" to your form.

Change the following Properties in the Object Inspector:

FileType = 3 - BMP_Bitmap
PageOption = 4 - OverwritePages
ScanTo = 2 - FileOnly


{***}

Das Setup Programm für Imaging (Ist bei Windows > 98 dabei)
installiert das Bild Scanning Control (OCX) und die 32-bit TWAIN DLLs.

Importiere das ActiveX-Control "Steuerung für Kodak-Bildscan".
(Im Menü Komponente, "ActiveX importieren" anklicken.)

Dann "Steuerung für Kodak-Bildscan..." auswählen und den
"Installieren..." Button anklicken.

Füge nun eine "TImgScan" Komponente aus dem Register "ActiveX" auf dem
Formular ein.

Ändere im Objektinspektor unter "ImgScan1" folgende Eigenschaften:

FileType = 3 - BMP_Bitmap
PageOption = 4 - OverwritePages
ScanTo = 2 - FileOnly


{***}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if 
imgScan1.ScannerAvailable then
    try
      
imgScan1.Image := 'c:\Scanner.bmp';
      imgScan1.OpenScanner;
      imgScan1.Zoom := 100;
      imgScan1.StartScan;
      Application.ProcessMessages;
    finally
      
imgScan1.CloseScanner;
      { Show the scanned image in Image1 }
      
imgScan1.Picture.LoadFromFile(Image1.Image);
    end;
end;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners