ผู้เขียน หัวข้อ: delphi test  (อ่าน 3307 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

doramon

  • บุคคลทั่วไป
delphi test
« เมื่อ: พฤศจิกายน 10, 2010, 15:41:59 PM »
0
      //Here we will scan in a 24bpp  in multiple page pdf file

       If Twain1.TwainOpenDefaultSource() Then
       begin

          Twain1.TwainSetAutoFeed (True); // Set AutoFeed Enabled
          Twain1.TwainSetAutoScan (True); // To  achieve the maximum scanning rate

          Twain1.TwainSetCurrentResolution (Resolution);
          Twain1.TwainSetCurrentPixelType (TWPT_RGB); // RGB
          Twain1.TwainSetCurrentBitDepth (8); // ' 24 bpp
          Twain1.TwainPdfStart('C:\multipage.pdf','','','','');


          While Twain1.TwainAcquireToGdPictureImage(Handle) <> 0 do
          Begin
             nImageID := Twain1.GetNativeImage;
             Twain1.TwainAddGdPictureImageToPdf(nImageID);
             Twain1.CloseImage (nImageID);
          end;
          Twain1.TwainPdfStop;
          Twain1.TwainCloseSource;
          ShowMessage('Done !');
       end Else
          MessageDlg('can´t open default source, twain state is: '+ IntToStr(Twain1.TwainGetState),
                     mtError,[mbok],0);