 |
|
 |
HI all ,
I tried to fix this issue from last 1 month onwards,TransferPictures() method returns pics count 1 alway ,when scanning multiple pages.previously it was working before changed Acquire() method code to set the user selected scanner.I have written the method setscanner() in Acquire().after wards it this code scan's multiple pages ,but TransferPictures() method returns pics count 1.One day i commented the method setscanner() in Acquire() method , then it works fine.after 2 day's it is not working.I dont know how it changes time to time.
please help me , this issue struggles me like anything...........
|
|
|
|
 |
|
 |
well done, great help for getting started!
|
|
|
|
 |
|
|
 |
|
 |
Hi ,
I am realatively new for programming, Please help me.
When I press acuqire it opens a window from my scanner
when I press cancel on it
the whole application get freezed. How to get rid from this.
thanks
|
|
|
|
 |
|
 |
How to pass scanning area parameter in the application. Like I want to scann only 10 centimeter from the top of the scanner. Thanks in advance.
|
|
|
|
 |
|
 |
I am trying to use API calls in c# to do A3 scanning. I am using the following code, but the result in the rc variable comes back as failure. I have used TwCap.
TwCapability capPaperSize = new TwCapability(TwCap.ICAP_SUPPORTEDSIZES, 1);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, capPaperSize);
if (rc != TwRC.Success)
{
CloseSrc();
return;
}
I have also used the following TwCap enum values in the TwCapability parameter, but the result are the same apart from TWSS_A4. A4 work but nothing else does. Am I doing something wrong. This really urgent I am using XEROX DocuMate 752 scanner.
TWSS_NONE = 0x0000,
TWSS_A4 = 0x0001,
TWSS_JISB5 = 0x0002,
TWSS_USLETTER = 0x0003,
TWSS_USLEGAL = 0x0004,
/* Added 1.5 */
TWSS_A5 = 0x0005,
TWSS_ISOB4 = 0x0006,
TWSS_ISOB6 = 0x0007,
/* Added 1.7 */
TWSS_USLEDGER = 0x0009,
TWSS_USEXECUTIVE = 0x000A,
TWSS_A3 = 0x000B,
|
|
|
|
 |
|
 |
can any one give this whole project in vb.net (windows application)
|
|
|
|
 |
|
|
 |
|
 |
How to acchieve the auto crop in twainlib.vb. where i have change the code.
|
|
|
|
 |
|
 |
How can i remove scanner UI and i would like to pass Auto Crop or Full Page and Color or Blackand white from our vb.net interface. How can i pass these parameters from the vb.net to twainlib.vb.
kindly help me.it is urgent.
|
|
|
|
 |
|
 |
The problem i am facing while running this code is, when i click acquire it throws up a UI for selecting an option of grayscale, color, black&white.
Is there any way i can get rid of the UI. I tried a lot analyzing it, but somehow the UI keeps pop up for me.
Is there any way i can manually enter the value for grayscale. So that it always scans in gray scale.
Plzzzz need help on this
|
|
|
|
 |
|
 |
Dear All,
The first come to here. I use the NET TWAIN image scanner.
But I Selet ADF Option, [Document In ADF] set more than 1 value,
then Scan button click.The TWAIN DS window display all long,
When Scan button click,I want to close the TWAIN window.
What Can I Do?Help Me..Thank you.
|
|
|
|
 |
|
 |
I could hide the user interface by commenting the line
//this.ShowUI;
But after commenting the line, only black and white image can be captured.
I want to capture color images.How can i solve this?
|
|
|
|
 |
|
 |
Could not compile the source code (VS 2010, Windows 7)
I receive the following error:
"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
|
|
|
|
 |
|
 |
"BadImageFormatException" is thrown when the application loads a DLL having incompatible bitness
(a 64 bit exe tried to load a 32bit DLL or a 32 bit exe tried to load a 64 bit DLL).
Make sure you compile your exe file as 32 bit (x86) !!!!.
|
|
|
|
 |
|
 |
The code below always returns false even if the scanner is online and ready. Can anyone see any problems with the code? I appreciate any help.
Public Function IsDeviceOnline() As Boolean
Try
Dim rc As TwRC
Dim capDeviceOnline As New TwCapability(TwCap.CAP_DEVICEONLINE)
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.DeviceEvent, capDeviceOnline)
If rc <> TwRC.Success Then
CloseSrc()
Return False
End If
Return True
Catch ex As Exception
Return False
End Try
End Function
Below is the TwainLib constructor.
Public Sub New()
appid = New TwIdentity()
appid.Id = IntPtr.Zero
appid.Version.MajorNum = 1
appid.Version.MinorNum = 1
appid.Version.Language = LanguageUSA
appid.Version.Country = CountryUSA
appid.Version.Info = "" ' TODO
appid.ProtocolMajor = TwProtocol.Major
appid.ProtocolMinor = TwProtocol.Minor
appid.SupportedGroups = CInt(TwDG.Image Or TwDG.Control)
appid.Manufacturer = ""
appid.ProductFamily = ""
appid.ProductName = ""
srcds = New TwIdentity()
srcds.Id = IntPtr.Zero
evtmsg.EventPtr = Marshal.AllocHGlobal(Marshal.SizeOf(_winmsg))
End Sub
|
|
|
|
 |
|
 |
I want to convert this sample application in asp.net. I have quoted here a portion from the source code. If you go through the source code then you will get the following portion in the MainFrame.cs.
public MainFrame()
{
InitializeComponent();
tw = new Twain();
tw.Init( this.Handle );
}
what will be the equivalent of the parameter this.Handle in asp.net.
|
|
|
|
 |
|
 |
use the native functions to get the ptr value for the active window as follows
tw.Init( GetForegroundWindow());
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
|
|
|
|
 |
|
 |
I used this code to rewrite an old application that used the Pegasus library for image scanning. The old application produced tiff images that were 2544 X 3296 and about 40kb in size. The Twain application produces tiff images that are 1700 X 2200 but are more than 2.5 mb in size.
I'm new to image processing. But, I'm guessing this has something to do with compression. How do turn compression on?
Thanks,
Mike
|
|
|
|
 |
|
 |
I am providing source internally and does not want to show the dialog box for selecting scanner type .please help
|
|
|
|
 |
|
|
 |
|
 |
I changed my code like this,
TwCapability cap = new TwCapability( TwCap.XferCount, 1);
to
TwCapability cap = new TwCapability( TwCap.XferCount, -1);
but its not working...please help me..
|
|
|
|
 |
|
 |
hello,I have a ADF question.Can you help me
The first come to here. I use the NET TWAIN image scanner.
But I Selet ADF Option, [Document In ADF] set more than 1 value,
then Scan button click.The TWAIN DS window display all long,
When Scan button click,I want to close the TWAIN window.
What Can I Do?Help Me..
|
|
|
|
 |
|
 |
I didn't get your question. If think you do not want to display the TWAIN GUI, for that you need to change
guif.ShowUI = 0; in Acquire() function in TwainLib.cs
TwUserInterface guif = new TwUserInterface();
guif.ShowUI = 0; //changed to 0
guif.ModalUI = 0;
guif.ParentHand = hwnd;
rc = DSuserif( appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.EnableDS, guif );
Is ADF working? If not working change Aquire() function like this.
// -1 for multiple pages
TwCapability cap = new TwCapability(TwCap.XferCount, -1);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap);
if (rc != TwRC.Success)
{
CloseSrc();
return;
}
//for ADF
TwCapability capFeeder = new TwCapability(TwCap.CAP_FEEDERENABLED, true);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, capFeeder);
if (rc != TwRC.Success)
{
CloseSrc();
return;
}
After that in TwainDefs.cs you have to add TwCapability() with 2 parameter.
//for enable/disable the capabilities
public TwCapability(TwCap cap, bool boolValue)
{
Cap = (short)cap;
ConType = (short)TwOn.One;
Handle = Twain.GlobalAlloc(0x42, 6);
IntPtr pv = Twain.GlobalLock(Handle);
Marshal.WriteInt16(pv, 0, (short)TwType.Bool);
Marshal.WriteInt32(pv, 2, Convert.ToInt16(boolValue) );
Twain.GlobalUnlock(Handle);
}
Add CAP_FEEDERENABLED = 0x1002 in enum TwCap in TwainDefs.cs
internal enum TwCap : short
{
CAP_FEEDERENABLED = 0x1002
}
|
|
|
|
 |
|
 |
Dear all,
I have posted 2 messages regarding ADF and Flatbed scanner. But still not get any reply for this...
Is it possible to use ADF and flatbed scanner in TWAIN? If so how to do that?
Please ...
|
|
|
|
 |