Can I get a higher resolution from getDrawingCache?

I am using SubsamplingScaleImageView from Dave Morrissey ( https://github.com/davemorrissey/subsampling-scale-image-view ) so that users can crop and pan a photo using gestures.

I modified the library to add shade and logo to the photo. Now I need to upload a photo to the server. To do this, I need to somehow extract the photo from the SubsamplingScaleImageView.

I added the following class to the SubsamplingScaleImageView class:

/**
 * Capture a photo of the image view
 */
public Bitmap getOutput() {
    buildDrawingCache();
    Bitmap b1 = getDrawingCache();
    Bitmap b = b1.copy(Config.ARGB_8888, true);
    destroyDrawingCache();
    return b;
}

      

I use this method to get the file, resize it to a specific resolution (800x800) and save it in my application folder.

I noticed that the extracted photo from the drawing cache depends on the device resolution. For example, on my Full HD device I get a 1080x1080 photo which is sufficient, but on some lower resolution devices I get resolutions like 480x480 and it is not enough since the image has to be larger so the photo becomes blurry when I change its size is up to 800x800.

Is there a way to get the same resolution photo from this image across all devices?

+3


source to share





All Articles