posted 16 years ago
Hi friends i'm using this code for capturing the screen . i want to set the quality of the image . how to do that?
baos = new ByteArrayOutputStream();
com.sun.image.codec.jpeg.JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder( baos ); // encode the image to jpg
enc.encode(BI);
FileOutputStream fos=new FileOutputStream("Screen_Shot_"+count+".jpg");
BufferedOutputStream bos = new BufferedOutputStream( fos );
byte[] b = baos.toByteArray();
bos.write( b );
bos.flush();
bos.close();