ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 About automatic rotation during scanning
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Flashcqxg

96 Posts

Posted - Jul 16 2023 :  22:13:05  Show Profile  Reply
1. My scanner supports automatic rotation based on text direction;
2. I set the scanning software that comes with the scanner to allow automatic rotation based on the text direction;
3. Then I set ImageEnMView1. MIO. TwainParams. AutoRotate in the Delphi program:=False;
But the images scanned through ImageEnMView actually rotate automatically according to the direction of the text. How can I solve this problem? Thank you!

xequte

38616 Posts

Posted - Jul 17 2023 :  21:24:31  Show Profile  Reply
Hi

What is the value of ImageEnMView1.MIO.TwainParams.AutoRotate before you set it to false? (It should already be false)

Enabling AutoRotate sets the capability ICAP_AUTOMATICROTATE. The scanner may not honor the passed value.

Does IsCapabilitySupported( ICAP_AUTOMATICROTATE ) return true?

https://www.imageen.com/help/TIETwainParams.IsCapabilitySupported.html

Also, are you definitely acquiring via Twain (rather than WIA, for example)?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Flashcqxg

96 Posts

Posted - Jul 17 2023 :  21:36:02  Show Profile  Reply
Hi,
I tested it and my scanner supports automatic rotation.
Go to Top of Page

Flashcqxg

96 Posts

Posted - Jul 17 2023 :  21:40:43  Show Profile  Reply
If I pass ImageEnMView1. MIO. TwainParams. SourceSettings. SaveToFile prohibits automatic rotation and saves it to the configuration file. Then, if the configuration file is called through SourceSettings. LoadFromFile for scanning, the automatic rotation will not occur.
Go to Top of Page

xequte

38616 Posts

Posted - Jul 17 2023 :  22:09:04  Show Profile  Reply
So it is as expected after SaveToFile (AutoRotate=False prevents rotation), but not as expected after LoadFromFile (AutoRotate=False has no effect)? Is that correct?

What is the value of AutoRotate before setting/loading in each case?

Can you show me some of the code that illustrates the issue?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Flashcqxg

96 Posts

Posted - Jul 17 2023 :  22:22:24  Show Profile  Reply
My Code:

if ImageEnMView1.MIO.SelectAcquireSource([ieaTwain, ieaWIA]) then
  begin
    case ImageEnMView1.MIO.SelectedAcquireSource.Api of
      ieaTwain:
        Memo1.Lines.Add('Api=ieaTwain');
      ieaWIA:
        Memo1.Lines.Add('Api=ieaWIA');
      ieaDCIM:
        Memo1.Lines.Add('Api=ieaDCIM');
      ieaNone:
        Memo1.Lines.Add('Api=ieaNone');
    end;

    if ImageEnMView1.MIO.TwainParams.IsCapabilitySupported(ICAP_AUTOMATICROTATE) then
      Memo1.Lines.Add('ICAP_AUTOMATICROTATE=True')
    else
      Memo1.Lines.Add('ICAP_AUTOMATICROTATE=False');

    if ImageEnMView1.MIO.TwainParams.AutoRotate then
      Memo1.Lines.Add('AutoRotate=True')
    else
      Memo1.Lines.Add('AutoRotate=False');

    with ImageEnMView1.MIO.TwainParams do
    begin
      AutoRotate := False;
      VisibleDialog := False;
      ShowSettingsOnly := False;
    end;

    if ImageEnMView1.MIO.TwainParams.AutoRotate then
      Memo1.Lines.Add('AutoRotate=True')
    else
      Memo1.Lines.Add('AutoRotate=False');
    ImageEnView1.Blank;
    ImageEnView1.Clear;
    ImageEnView1.Update;
    ImageEnMView1.MIO.Acquire();
  end;


Api=ieaTwain
ICAP_AUTOMATICROTATE=True
AutoRotate=False
AutoRotate=False


Go to Top of Page

xequte

38616 Posts

Posted - Jul 17 2023 :  22:39:50  Show Profile  Reply
Great, thanks.

So in this case it auto-rotates anyway? Correct?

And if you insert SaveToFile/LoadFromFile it prevents the auto-rotation?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Flashcqxg

96 Posts

Posted - Jul 17 2023 :  22:45:56  Show Profile  Reply
So in this case it auto-rotates anyway? Correct?
—Yes.I can not prevent it auto-rotation.


And if you insert SaveToFile/LoadFromFile it prevents the auto-rotation?

—Yes.If I use SourceSettings.SaveToFile to disable rotation and then use SourceSettings.LoadFromFile to load the settings, it will not automatically rotate.
Go to Top of Page

xequte

38616 Posts

Posted - Jul 17 2023 :  22:54:57  Show Profile  Reply
Hmm, can you email for a test version where you can explicitly force setting of Twain capabilities using:

iegExplicitlySetTwainCapabilities := True;

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Flashcqxg

96 Posts

Posted - Jul 17 2023 :  23:41:42  Show Profile  Reply
Sorry, I didn't understand:
IegExplicitlySetTwainCapabilities:=True;
Go to Top of Page

xequte

38616 Posts

Posted - Jul 18 2023 :  17:16:42  Show Profile  Reply
Hi

Yes, it is a new test variable. But you need to be using the latest beta, v12.2.0.0718.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: