Forum Replies Created
- AuthorPosts
Yes you have discovered a bug in the code.
some #ifdef TWH_CMP_MSC around the code for MSG should resolve it for Linux for now.#ifdef TWH_CMP_MSC
MSG Msg;
if(!GetMessage((LPMSG)&Msg, NULL, 0, 0))
{
break;//WM_QUIT
}
#endif
#ifdef TWH_CMP_MSC
TranslateMessage ((LPMSG)&Msg);
DispatchMessage ((LPMSG)&Msg);
#endif
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************February 20, 2009 at 8:26 pm in reply to: 2.0 Why can’t find source which can be found by Twain1.7 #24774I tested a Canon Power Shot A460 and it worked.
Canon only supplies TWAIN drivers for Win2000 so that is where I tested. The same for the A590IS. The TWAIN driver will not install on WinXP.I was able to use the Sample TWAIN2 application to see and transfer images from the camera.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************If the scanner is enabled with the UI, are those settings chosen? With UI open, if you choose 16 bit, is that what you get? If the transfers produce 16 bit in this case then it is a problem with the DS.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************February 18, 2009 at 6:51 pm in reply to: 2.0 Why can’t find source which can be found by Twain1.7 #24773You may have found an issue. By setting an environment variable you can create a log file from the DSM that may help narrow down the issue.
right click “My Computer” | Properties | Advanced | Environment Variables
in “User variables for yourname”, Newvariable name: TWAINDSM_LOG
Variable value: %temp%twain2.logOk | Ok | Ok
Run the sample TWAIN2 application to display the list of DS. Close.
View log file.
Start | run | %temp%twain2.log | okRegards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************Yes the proper method to get resolution is with DG_IMAGE / DAT_IMAGEINFO / MSG_GET operation triplet.
This triplet should always be used to determine what kind image image data is returned prior to every transfer.
Requesting the scanner for a pixel type, bit depth, or a resolution, is only a request. It is not guaranteed that is what you will get. Some scanners offer an automatic color detection. They might return jpeg compressed data for color images and G4 compressed data for b&W pages. (But no TWAIN driver should return compressed data unless requested by the application)
Yes it would be a bug with this TWAIN driver if the DIB does not contain the correct resolution.
Regards,
Jim Watters**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************February 9, 2009 at 7:20 pm in reply to: How to handle "No page in scanner, add page to scanner? #24790Try setting CAP_INDICATORS to FALSE
Jim Watters
I am not sure what it is you are developing.
Are you developing a TWAIN datasource for a particular digital camera?
Are you developing a TWAIN application that knows how to transfer pictures from any TWAIN datasource for a camera.You can find sample code for creating both a TWAIN Application and a TWAIN datasource on SourceForge using version 2.0 of the specification.
https://sourceforge.net/projects/twain-samples/I believe there is some confusion between the version of the file and the specification.
TWAIN_32.dll is distributed by Microsoft. It is included with Windows XP, 2000, Vista. Although the file version is 1.7 This dll still works with the TWAIN application and datasources that are TWAIN compliant up to and including the current 2.0 version of the specification. Although new TWAIN 2.0 applications will be distributing the new DSM from SourceForge. Currently version of the file 2.0.4. Links at the top of twain.org
If you are looking for a kit to help develop using TWAIN.
ObjectTWAIN is a toolkit for creating TWAIN datasources and applications.
http://www.jflinc.com/ObjectTWAIN.html
Soon to be released as TWAIN 2.0 compliant.Jim Watters
jimw@jflinc.com
**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************Native transfer only offers a handle to a Device Independent Bitmaps (DIB). DIB are not 16bit per channel.
You are better using memory or file transfer.
The order you want to set these items are.
XFERMECH
ICAP_IMAGEFILEFORMAT (if using file)
ICAP_PIXELTYPE
ICAP_BITDEPTH
ICAP_COMPRESSIONJim Watters
I believe your last call with DG_CONTROL,DAT_PENDINGXFERS,MSG_RESET inside your do loop is to blame. Remove this.
(*DSM_ENTRY) (&g_AppID,&g_SrcID,DG_CONTROL,DAT_PENDINGXFERS,MSG_RESET,(TW_MEMREF) &pxfers);
I still believe that the structure packing is not correct.
twain.h uses __BORLANDC__ to determine if you are using a Borland compiler. Make sure this is set in your environment. The switch for Borland is different than the one I gave earlier.
#ifdef __BORLANDC__
#pragma option -a2
#else
Jim Watters
Sounds like the structure packing is not set to 2
#pragma pack (2)
This is done automatically if you are including twain.h to get the structures. If you are defining your own structures then you will need to do this yourself.
Jim
I just looked at the TW_IDENT ITY structure of several version of twain.h including the TWAIN Developers Toolkit, and all versions are correct and the same:
TW_UINT32 SupportedGroups;
Where is the version of twain.h that has SupportedGroups as TW_UINT16?
(*) The form editor does not like the word i d e n t i t
Very strange 🙁 ?- AuthorPosts