Skip to content Skip to sidebar Skip to footer

How To Make Android Screenshots Saved As .jpg?

I am using ExifInterface to save information for image description. But because screenshots are save .png and ExifInterface doesn't work on .png, I cannot save image description fo

Solution 1:

You can take advantage of a View's drawing cache.

myView.setDrawingCacheEnabled(true);
Bitmapb= view.getDrawingCache();
b.compress(CompressFormat.JPEG, 95, newFileOutputStream("/some/location/image.jpg"))

Where view is your View. The 95 is the quality of the JPG compression. And the file output stream is just that.

Post a Comment for "How To Make Android Screenshots Saved As .jpg?"