 |
|
 |
when i scanning multi-page documents, then cancel it to pause the operation, the program run into dead.
pclion
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You need to handle cancel event/return message. VB.Net Sample: In TwainLib Declarations: Public Event TransferReady() Public Event AbortTranfer() PassMessage: RaiseEvent TransferReady()... Or other events declared...
Heavy givers are light complainers
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
when you not have a scanner device you use a file image to process . But when use this the twain dsm took the image from the default folder on the machine. I need to make a form to change the source of the image to be acquire. How can I do this. Plese help me !!!!!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi!
I have a problem scanning from minolta microfilm scanner. Pixel type returned is 1bpp, i get pointer to dib, but then when trying to aquire BITMAPINFOHEADER it sets all fields to -1, and image cannot be converted from DIB to Bitmap.
Anyone has any idea how to fix that? Thanks
public static IntPtr GetPixelInfo(IntPtr bmpptr, ref Rectangle bmprect) { BITMAPINFOHEADER bmi = new BITMAPINFOHEADER(); Marshal.PtrToStructure(bmpptr, bmi); <<------ bmi fields set to -1 bmprect.X = bmprect.Y = 0; bmprect.Width = bmi.biWidth; bmprect.Height = bmi.biHeight;
if (bmi.biSizeImage == 0) bmi.biSizeImage = ((((bmi.biWidth * bmi.biBitCount) + 31) & ~31) >> 3) * bmi.biHeight;
int p = bmi.biClrUsed; if ((p == 0) && (bmi.biBitCount <= 8)) p = 1 << bmi.biBitCount; p = (p * 4) + bmi.biSize + (int)bmpptr; return (IntPtr)p; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello, Everything works fine when i'am using WIA driver's But when using the Twain drivers for the most scanners i use (also network scanners), the dsuerif method to open the userinterface does NOT wait the user response on the user interface (scan or cancel) and returns a SUCCESS call ..... and my app loops. Do i something wrong? why the method does not wait and returns directly SUCCESS ?
guif.ShowUI = 1; guif.ModalUI = 1; guif.ParentHand = hwnd; rc = DSuserif(appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.EnableDS, guif); if (rc != TwRC.Success) { CloseSrc(); return 0; }
Thanks a lot for your help .....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
How can I get two or more image in one click? what function shoould I use? or Import from the Library?
Thanks Before,
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hum... it is very easy with a scanner like DR-1210 from canon, you just has to change this line :
TwCapability cap = new TwCapability(TwCap.XferCount, 1); with
TwCapability cap = new TwCapability(TwCap.XferCount, -1);
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
One word - GENIUS!!!
This one line saved me a day's trawl on google!!!!
Thanks a million!
Heavy givers are light complainers
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi ! I'm currently using this code source, but, when I call scan process, my form freeze, so I'm trying to move the scanning part on another thread, but it's crash.
Someone has solutions or succed to scan on another thread ?
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Plz help me; when i press acquire ,scanner starts but it took only one side it didnt come back how to solve this plzzzzzzzzzzzzz
amit
|
| Sign In·View Thread·PermaLink | 1.80/5 (4 votes) |
|
|
|
 |
|
 |
Hi all,
I execute the application and i want to select the scanner in order to acquire my images. But, clicking on the menu "Select source...", no form or dialog window appears!!! In c:\windows\ and also in c:\windows\system32 i have the file twain_32.dll How can i solve this problem??? Please, help me! thanks in advance
Rob
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
I implemented a scanner application and I can raises the dialog for scanning.
In that dialog, I can actually select or create scanning profile.
Does anyone know if it is possible to raise the dialog and have a specified profile selected automatically?
Thanks.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi, I have a great problem... I must scan many pages from a scanner with adf. I can set xfercount to -1, feederenabled at true and it works... BUT i get the TW_COMMAND.TRANSFERREADY in the message loop only when ALL images in the adf have been scanned... I do not want this; i need to transfer ONE image a time... get one image, view it and then continue scanning (automatically after a bit of time). To do this i tryed to set XFERCOUNT to 1 and then (the image pass) after transferring data, I polled for the presence of paper, GetCapability(CAP_FEEDERLOADED) -> return TRUE... NOW, ho to scan the next page??? I tryed to do something like this
public bool Feed() { TwCapability cap = new TwCapability(TW_CAP.CAP_FEEDPAGE, true); TW_RETURNCODE rc = CapabilitySet(cap); return (rc == TW_RETURNCODE.TWRC_SUCCESS ? true : false); }
but it does not works and return always FAILURE... any suggestion? thank you in advance Michele
p.s.
TwCapability is correctly implemented for bool... please avoid to suggest "rewrite TwCapability"...
modified on Wednesday, January 28, 2009 8:00 AM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
c#. When i try to delete file after create with GdipSaveImageToFile. An error of file locked occurs. I need to create file GdipSaveImageToFile and then delete it. Any idea? Thanks
modified on Tuesday, January 27, 2009 1:12 PM
|
| Sign In·View Thread·PermaLink | 3.00/5 (2 votes) |
|
|
|
 |
|
 |
Hi,
I am getting the following error "Unable to load DLL 'twain_32.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)" even thought scanner is not attached to my system. I am using an applicaiton which has scanner compatibility.
Stack trace:
TargetSite : TwainLib.TwRC DSMparent(TwainLib.TwIdentity, IntPtr, TwainLib.TwDG, TwainLib.TwDAT, TwainLib.TwMSG, IntPtr ByRef) Stack Trace : at TwainLib.Twain.DSMparent(TwIdentity origin, IntPtr zeroptr, TwDG dg, TwDAT dat, TwMSG msg, IntPtr& refptr) at TwainLib.Twain.Init(IntPtr hwndp)
Please help!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
in twaindefs i have the following definitions
internal enum TwCap : short { XferCount = 0x0001, // CAP_XFERCOUNT ICompression = 0x0100, // ICAP_... IPixelType = 0x0101, IUnits = 0x0102, IXferMech = 0x0103, IXResolution = 0x1118, IYResolution = 0x1119, ISupportedSizes = 0x1122, XScaling = 0x1124, YScaling = 0x1125 } internal enum TwSS : short { // page size TwSS_None = 0, TwSS_A4 = 1, TwSS_B5Letter = 2, TwSS_USLetter = 3 }
and in the twainlib.cs ıhave following code
TwCapability cap = new TwCapability(TwCap.ISupportedSizes, -1 ,TwType.Int16);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap); if (rc != TwRC.Success) { CloseSrc(); return; }
what is the problem ?
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
bottom part of aboce code
TwCapability cap = new TwCapability(TwCap.ISupportedSizes, (short)TwSS.TwSS_A4 ,TwType.Int16);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap); if (rc != TwRC.Success) { CloseSrc(); MessageBox.Show("hata page size"); return; }
still not working..
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
I tried to run this example using VS2008 in Vista. I manage to call up my scanner twain setup page. But When I click on "Scan", it shows a pop up saying "scanning...".
However, there's no actual response form my scanner. Things just stop right there, with no error message.
When I use the software that comes with it, the same menu pops up, and the "scan" worls just fine.
May Anyone sggetst what is happening?
Thanks.
|
| Sign In·View Thread·PermaLink | 2.00/5 (4 votes) |
|
|
|
 |
|
|
 |
|
 |
kengct wrote: help....~~~~
Yes I have this problem, I suffer this on my own application also...
help....~~~~
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |