New OpenSource Image Scanning (Twain/Sane) Framework Found
807589Feb 6 2004 — edited Sep 22 2008Hy all
I found a very very useful scanning framework which is licenced under the BSD license. This library works on windows as linux and some other unixes. Look at http://www.mms-computing.co.uk/ . Download the jar file and run it first java -jar <jarfile>. This comiles the classes and other c-objects.
I'm not the developper of this software but as I searched for a similar tool, if found just expensive ones and i saw that some others has been searched for Twain/Sane tools. So here it is.
Roland
It can be very easely used. Look at the following code construct.
public class ImageTab extends JPanel implements ScannerListener{
public ImageTab(){
Scanner scanner=Scanner.getDevice();
if(scanner!=null){
scanner.addListener(this);
add(scanner.getScanGUI());
}
.
.
.
}
public void update(ScannerIOMetadata.Type type, final ScannerIOMetadata metadata){
if(type.equals(ScannerIOMetadata.ACQUIRED)){
BufferedImage img=metadata.getImage();
.
. do what you have to do
.
}else if(type.equals(ScannerIOMetadata.STATECHANGE)){
switch(metadata.getState()){
.
. do what you have to do
.
}
Log.msg("Scanner State "+metadata.getStateStr());
}else if(type.equals(ScannerIOMetadata.INFO)){
Log.msg(metadata.getInfo());
}else if(type.equals(ScannerIOMetadata.EXCEPTION)){
Log.err(metadata.getException());
}
}
}