Home › Forums › TWAIN Classic › How to set the resolution (DPI)? › Reply To: How to set the resolution (DPI)?
February 12, 2010 at 7:04 pm #24006
I am using the following code with JTwain to try to set the DPI to 499 x 499 but the resulting scanned image has 96 x 96 DPI. How can I set the resolution?
Try the following code from Morena – Image Acquisition Framework for Java (http://www.gnome.sk):
TwainSource source=TwainManager.selectSource(null);
source.setVisible(false);
source.setGrayScaleMode();
source.setResolution(499);
MorenaImage image=new MorenaImage(source);
System.err.println("Size of acquired image is "+
+image.getWidth()+" x "
+image.getHeight()+" x "
+image.getPixelSize());
TwainManager.close();
You can also run TwainAutomatedTest.java (test.bat, test.sh located at the examples directory of the distribution package). It will write all supported capabilities of your Twain driver to the twainAutomatedTest.txt file. You can see there for the interval of the supported resolutions.
Martin Motovsky
Member of Gnome’s technical support