how to decrease the size of the jpeg image file?
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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();
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();
akash kumar
Ranch Hand
Posts: 69
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Ulf Dittmer! Thanks for the help provided by you.
akash kumar
Ranch Hand
Posts: 69
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Ulf Dittmer!
I'm having problem. This line of code is raising nullpointer exception "JPEGEncodeParam param = enc.getJPEGEncodeParam();". what might be the problem?
I'm having problem. This line of code is raising nullpointer exception "JPEGEncodeParam param = enc.getJPEGEncodeParam();". what might be the problem?
Ulf Dittmer
Rancher
Posts: 43081
77
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Is "enc" null? If not, post the stack trace.
| Hey cool! They got a blimp! But I have a tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |






