Tattakashi123 / t

Automatically exported from code.google.com/p/twaindotnet
0 stars 0 forks source link

scan a specified area #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
TW_FRAME struct in http://www.twain.org/devfiles/twain.h shows that is 
possible to specify a delimited scanning area, so looks cool to have this 
kind of functionality inside twiandotnet, if possible.

Original issue reported on code.google.com by diegogu...@gmail.com on 29 Dec 2009 at 9:52

GoogleCodeExporter commented 8 years ago
of course this isn't a defect but an ehnancement of current capabilities

Original comment by diegogu...@gmail.com on 29 Dec 2009 at 9:53

GoogleCodeExporter commented 8 years ago
I've committed the changes to introduce this kind of support in my local 
repository, 
coukd someone help-me with mercurial to push this changes to main repository, 
of course 
creating a patch or something similar)?

Original comment by diegogu...@gmail.com on 4 Jan 2010 at 3:23

GoogleCodeExporter commented 8 years ago
I've tried to generate the patch but I'm not sure that this file works.
Hope someone could take a look soon...

Original comment by diegogu...@gmail.com on 4 Jan 2010 at 4:07

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Diego,

Firstly, thanks for putting the time into implementing this feature! 
Unfortunately 
that patch didn't seem to work for me. Perhaps you can make a clone of the 
repository 
(http://code.google.com/p/twaindotnet/source/createClone), push your changes 
there 
and I'll pull them back down. That should record your details in the commit 
history 
as well.

Cheers,

Luke

Original comment by luke.qui...@gmail.com on 5 Jan 2010 at 12:47

GoogleCodeExporter commented 8 years ago
Thanks for support, I want to add some features, then I try to clone the 
repository as 
you suggests. If I'm unable to do this procedure, I send to you the modified 
files: 
applying manually the changes is pretty easy because the modified files are few.

Original comment by diegogu...@gmail.com on 5 Jan 2010 at 7:42

GoogleCodeExporter commented 8 years ago
changes pushed into clone: http://code.google.com/r/diegoguidi-scanarea/
I've tried to add PageType support (see enumeration) but when I set relative 
capability, I receive an "unsupported error". I need more investigation.

Original comment by diegogu...@gmail.com on 5 Jan 2010 at 8:49

GoogleCodeExporter commented 8 years ago
Hi Diego,

I've push your current changes into the trunk with a few minor style changes. 
Thanks 
again for implementing that work so far. Good luck with the PageType support!

Cheers,

Luke

Original comment by luke.qui...@gmail.com on 12 Jan 2010 at 12:30

GoogleCodeExporter commented 8 years ago
glad to be helpful :)

Original comment by diegogu...@gmail.com on 12 Jan 2010 at 2:02

GoogleCodeExporter commented 8 years ago
>Good luck with the PageType support!
Actually I've stopped my work for three main reasons:
1) PageType looks not so useful, just because you could specify an area that is 
large 
as an A5 page, without specifying directly to grab a Page A5 as fullpage.
2) PageType in my scanner isn't a supported capability: I need at least another 
scanner to test if PageType is supported.
3) Can be useful a way to check all supported capabilities: TWAIN supports this 
feature (see #define CAP_SUPPORTEDCAPS in 
http://www.twain.org/devfiles/twain.h) but 
is not so simple to read this info :(

Original comment by diegogu...@gmail.com on 13 Jan 2010 at 1:36

GoogleCodeExporter commented 8 years ago
Issue 11 has been merged into this issue.

Original comment by luke.qui...@gmail.com on 1 Apr 2010 at 12:22

GoogleCodeExporter commented 8 years ago
Hi Diego, can you please attach the updated TwainDotNet.dll file here (so i can
download it)? I would like to have the AreaSettings feature and it doesnt exist 
in
the latest downloadable version. I'd appreciate it...

Thanks,

Original comment by ziggy9...@gmail.com on 4 May 2010 at 6:07

GoogleCodeExporter commented 8 years ago
check the code from this hg clone:
http://code.google.com/r/diegoguidi-scanarea/source/browse

Original comment by diegogu...@gmail.com on 4 May 2010 at 8:08

GoogleCodeExporter commented 8 years ago
i checked the code and saw the changes made. However all i have is a DLL file 
(no
source code). So i cant really make the changes myself. In the downloads 
section, the
zip file only contains the DLL files. Is there anywhere to download the source 
code
files so i can apply the changes? Or better yet, a compiled DLL that already 
includes
it...? 

Original comment by ziggy9...@gmail.com on 4 May 2010 at 8:21

GoogleCodeExporter commented 8 years ago
the best way to make changes is to checkout the code with tortoisehg from this 
link:
https://diegoguidi-scanarea.googlecode.com/hg/

Original comment by diegogu...@gmail.com on 4 May 2010 at 8:35

GoogleCodeExporter commented 8 years ago
Diego, thanks for the quick reply. I got the updated code.

The code was working fine before (the scanner was scanning the image). However 
when i
added an AreaSettings object to my ScanSetting's Area property, i get the 
following
error are runtime: 

"Failed to set capability."

Am i doing anything wrong? Here's my code:

==========================================================================

AreaSettings AreaSettings = new AreaSettings(Units.Centimeters, 0.1f, 5.7f, 
0.1F +
2.6f, 5.7f + 2.6f);

            settings = new ScanSettings();
            settings.UseDocumentFeeder = false;
            settings.ShowTwainUI = false;
            settings.Resolution = ResolutionSettings.ColourPhotocopier;

            settings.Area = AreaSettings; // Adding this line causes the error...

            destinationFile = destination;

            twain.ScanningComplete += new EventHandler(twain_ScanningComplete);

            try
            {
                twain.StartScanning(settings);
            }
            catch (TwainException ex)
            {
            }

Original comment by ziggy9...@gmail.com on 4 May 2010 at 8:59

GoogleCodeExporter commented 8 years ago
Probably the same issue of other users, your scanner don't support
this capability, but I don't know how to discover at runtime if a
specified scanner could manage AreaSettings

Original comment by diegogu...@gmail.com on 4 May 2010 at 4:13

GoogleCodeExporter commented 8 years ago
you can see my code in Issue #15. I have that part commented. You can try it out
there if you like...

Original comment by ziggy9...@gmail.com on 4 May 2010 at 8:10