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
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
> 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