Forums › TWAIN Classic › A question about image resolution
- This topic has 1 reply, 2 voices, and was last updated 11 years, 11 months ago by jimwatters.
-
AuthorPosts
-
When scanning using TWAIN, my software currently takes the image resolution of the scanned image from the BITMAPHEADERINFO in the returned DIB.
This has worked fine up until now.
However, I have recently tried the software on a scanner (Solar Imaging M5) where the correct resolution was NOT stored here.
After investigation, the correct resolution (226dpi) was returned by querying the TWAIN driver with the DG_IMAGE / DAT_IMAGEINFO / MSG_GET operation triplet.
So the question is, if this value is different to the resolution contained in the BITMAPHEADERINFO, which value should I take as being correct?
Also, would it be considered a bug in the TWAIN driver that the DIB does not contain the correct resolution (it actually contains a resolution of 583115590 pixels/m = 14811166 dpi)
Any advice on this is greatly appreciated.
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.
************************************************** -
AuthorPosts