I display a photo on the screen:
Bitmap bitmap = decodeSampledBitmapFromResource(data, 100, 100); The decodeSampledBitmapFromResource () method looks like this:
public static Bitmap decodeSampledBitmapFromResource(String path, int reqWidth, int reqHeight) { // First decode with inJustDecodeBounds=true to check dimensions final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(path, options); // Calculate inSampleSize options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight); // Decode bitmap with inSampleSize set options.inJustDecodeBounds = false; return BitmapFactory.decodeFile(path, options); } When you rotate a photo 90 degrees with the Matrix photo becomes blurry:
Matrix matrix = new Matrix(); matrix.postRotate(90); Bitmap bitmap = decodeSampledBitmapFromResource(data, 100, 100); bitmap=Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); Why is the quality of the photo deteriorating? And how to do, what would it be in normal quality?