Jump to content
Sign in to follow this  
Gary

DelphiTwain Exception & retrieve selected resolution

Recommended Posts

From Delphi Twain - scan documents with Delphi (kluug.net)

Windows 10, Delphi 11

 

Hello all,

 

When I run the sample vcl1 in the debugger I get a EZCompressionError here.

if Assigned(FTwain.SelectedSource) then
  begin
    try
      // Load source, select transference method and enable
      FTwain.SelectedSource.Loaded := TRUE;
      // display interface
      FTwain.SelectedSource.ShowUI := TRUE;
      // Scan
      FTwain.SelectedSource.Enabled := TRUE;     
    except
      on E: EZCompressionError do
        { TODO :
          Nothing, does not effect.
          Investigate, caused by
          FTwain.SelectedSource.Loaded &
          FTwain.SelectedSource.Enabled }
    end;
  end;

Anyone else get this? Any fix?

 

Also I need to get the scanner resolution used. I tried this: 

var lReturn : Extended;
var lValues : TTwainResolution;
var lResult : TCapabilityRet :=
  FTwain.SelectedSource.GetIYResolution(lReturn, lValues);

but the return value is crUnsupported on a newer Canon Color Image Class laser printer.

Is there another way to get the selected resolution? 

 

Thanks,

Gary

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×