Java based Image Scanning

Hi all

I am developing one java webstart application in which i need to give option of scanning an image and upload...

I want to know... how well java supports image scanning....?

If there are some sample source codes for scanning... pls let me know

If anyone has worked on such applications... pls help me out...

Thanks & Regards

Chandrakanth

[392 byte] By [Chandrakantha] at [2007-10-2 3:59:45]
# 1
Here is a comment from earlier days http://forum.java.sun.com/thread.jspa?threadID=489217&messageID=2459932
morgalra at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 2
and another http://forum.java.sun.com/thread.jspa?threadID=344663&messageID=1423058
morgalra at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 3
here is one from google: http://www.programmersheaven.com/2/Java-Twain-image-acquisition
morgalra at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 4

use imageio class to get image

BufferedImage bi = ImageIO.read("url");

the bufferedImage class has method called getRGB

int tRGB[][] = new int[bi.width][bi.height];

for(int x=0;x<bi.width;++x){

for(int y =0;y<bi.height;++y){

tRGB[x][y] = bi.getRGB(x,y);

}

}

now tRGB[x][y] has the integer number repesented by binary combination of RGB

ie

binary 101010101000000011001010

to get three colors separated

use right shift

and AND it with ff;

int red = (tRGB[x][y]>>16)&0xff;

int green = (tRGB[x][y]>>8)&0xff;

int blue =tRGB[x][y]&0xff;

doing above process in loop u get three arrays of ntegers R G and B

now u can play with them as u wish.

there are processes faster than this one.

pls let me know if u come across any new.

rgds,

z_idane

z_idanea at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 5
If the scanner is connected to the system... which url shud i use in ImageIO read method....
Chandrakantha at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 6
to get image from scanner into ur applicationtry jtwain or jmfjmf is freely downloadable from sun site.
z_idanea at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...
# 7

> Hi all

>

> I am developing one java webstart application in

> which i need to give option of scanning an image and

> upload...

> I want to know... how well java supports image

> scanning....?

> If there are some sample source codes for scanning...

> pls let me know

> If anyone has worked on such applications... pls help

> me out...

>

> Thanks & Regards

> Chandrakanth

Take a look at this scan and upload applet:

http://asprise.com/product/jtwain/webdemo.php

_Jack_a at 2007-7-15 23:21:36 > top of Java-index,Desktop,Developing for the Desktop...