VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234567[8]910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 17:58:43 04/11/01 Wed
Author: Michel
Subject: Re: Scanning with AutoSheetFeeder
In reply to: Joerg Petersen 's message, "Scanning with AutoSheetFeeder" on 06:01:34 04/11/01 Wed


Hi Joerg,

I have not tested with scanners that have both a sheet feeder and flatbed. With scanners that

have a sheet feeder only I have not had problems.

You may want to check the scanners user interface for an option that selects the sheet feeder.

The twain code in Envision keeps on receiving images until the scanner driver returns that

there are no longer any images left.

Tomaz Koritnik, Slovenija, has created functions to enable/disable the feeder which I have not

yet integrated in Envision. You may want to try them out on your scanner.

Best regards,

Michel

function TScanner.EnableFeeder: Boolean;
var
Cap: TW_CAPABILITY;
p: pTW_ONEVALUE;
Status: TW_INT16;
begin
LoadTwain;
Cap.Cap := CAP_FEEDERENABLED;
Cap.ConType := TWON_ONEVALUE;
Cap.hContainer := 0;
status := FTwainData.DsmEntry( @FTwainData.AppId,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_GET,
TW_MEMREF(@Cap) );
if Status <> TWRC_SUCCESS then
begin
GlobalFree( Cap.hContainer );
Result := false;
end else
begin
p := pTW_ONEVALUE(GlobalLock( cap.hContainer ));
if Boolean(p^.Item) = true then
begin
GlobalUnlock( cap.hContainer );
GlobalFree( cap.hContainer );
Result := true;
end else
begin
p^.ItemType := TWTY_BOOL;
p^.Item := Cardinal(True);
GlobalUnlock( cap.hContainer );
status := FTwainData.DsmEntry(@FTwainData.appID,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_SET,
TW_MEMREF(@cap) );
GlobalFree( cap.hContainer );
if Status = TWRC_SUCCESS then Result := true else
Result := false;
end;
end;
end;

function TScanner.DisableFeeder: Boolean;
var
Cap: TW_CAPABILITY;
p: pTW_ONEVALUE;
Status: TW_INT16;
begin
LoadTwain;
Cap.Cap := CAP_FEEDERENABLED;
Cap.ConType := TWON_ONEVALUE;
Cap.hContainer := 0;
{ get feeder status }
status := FTwainData.DsmEntry( @FTwainData.AppId,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_GET,
TW_MEMREF(@Cap) );
if Status <> TWRC_SUCCESS then
begin
{ error or no feeder support }
GlobalFree( CAp.hContainer );
Result := false;
end else
begin
{ check feeder status }
p := pTW_ONEVALUE(GlobalLock( cap.hContainer ));
if Boolean(p^.Item) = true then
begin
{ feeder is enabled }
GlobalUnlock( cap.hContainer );
p.ItemType := TWTY_BOOL;
p.Item := Cardinal(False);
GlobalUnlock( cap.hContainer );
{ disable feeder }
status := FTwainData.DsmEntry(@FTwainData.appID,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_SET,
TW_MEMREF(@cap) );
GlobalFree( cap.hContainer );
if Status = TWRC_SUCCESS then Result := true else
Result := false;
GlobalFree( cap.hContainer );
Cap.Cap := CAP_FEEDERENABLED;
Cap.ConType := TWON_ONEVALUE;
Cap.hContainer := 0;
{ check if feeder is really disabled }
status := FTwainData.DsmEntry( @FTwainData.AppId,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_GET,
TW_MEMREF(@Cap) );
if Status = TWRC_SUCCESS then
begin
p := pTW_ONEVALUE(GlobalLock( cap.hContainer ));
if Boolean(p.Item) = true then result := false else
Result:= true;
end;
end else
begin
Result := true;
GlobalUnlock( cap.hContainer );
GlobalFree( cap.hContainer );
end;
end;
end;

function TScanner.FeederLoaded: Boolean;
var
Cap: TW_CAPABILITY;
Status: TW_INT16;
p: pTW_ONEVALUE;
begin
LoadTwain;
Cap.Cap := CAP_FEEDERLOADED;
Cap.ConType := TWON_DONTCARE16;
status := FTwainData.DsmEntry( @FTwainData.AppId,
@FTwainData.SourceId, DG_CONTROL, DAT_CAPABILITY, MSG_GET, @Cap );
if status <> TWRC_SUCCESS then Result := false else
begin
p := pTW_ONEVALUE(GlobalLock( Cap.hContainer ) );
if Boolean(p^.Item) = true then
Result := true else
Result := false;
GlobalUnlock( cap.hContainer );
GlobalFree( cap.hContainer );
end;
end;

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.