- Topics - 0
- Replies - 1
- Total Posts - 1
I am using JTwain and facing the same problem that dabd is facing. I have verified that the resolution (200 x 200) in which I am trying to scan is supported by the scanner. In fact I also verified that when UI is enabled we can see that the driver (in my case HP Scanner dialogue) has actually received the DPI settings, though getCurrentXResolution and getCurrentYResolution are reporting 1.0, but when the scanned image is verified in MSPaint it reports 96 x 96 DPI and GIMP reports 72 x 72 DPI.
The code snippet used is as below
source.setUnits( JTwainConstants.TWUN_PIXELS );
source.setXResolution( 200.00 );
source.setYResolution( 200.00 );
ImageIO.write( source.acquireImageAsBufferedImage(), "jpeg", bos );
JpegBase64 = Base64.encode( bos.toByteArray() );
Any help will be much appreciated.