0

Hello Guys i trying to resize a bitmap using the comand Bitmap.CreateScaleBitmap but that comand create an new image at the my dispositivo. i need in one solution for resize not create one new image.

my code:

if(requestCode ==0){

            Bitmap bitmap = null;

            try {


                uri_image_boi=data.getData();

                bitmap=MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(),uri_image_boi);

                Bitmap resizedBitmap = Bitmap.createScaledBitmap(bitmap,600,400,false);

                image_boi.setImageDrawable(new BitmapDrawable(resizedBitmap));

                botao_adicionar_foto.setAlpha(0);

                resize= getImageUri(this,resizedBitmap);

            } catch (Exception e) {

            }
        }
    }
Vinicius
  • 1
  • 1
  • What do you mean by not creating an image? in the disk (memory card) or memory, you mean? – Arrowsome Jun 17 '20 at 20:18
  • Perhaps [this answer](https://stackoverflow.com/a/20407231/3818303) can help you? – instanceof Jun 17 '20 at 20:20
  • Yes, when I resize it is creating another image on my phone, she goes to the pictures folder. – Vinicius Jun 18 '20 at 10:46
  • `getImageUri(this,resizedBitmap)` That is creating a file. But you did not post code for it. Bitmap.CreateScaleBitmap does not create a new file. Only a bitmap. – blackapps Jun 19 '20 at 13:12
  • yes it is creating a new bitmap in the smartphone gallery as if it were a new image. don't want him to do that have any other function? – Vinicius Jun 19 '20 at 16:05

0 Answers0