How to Resize a Bitmap in Android?

后端 未结 16 2045
有刺的猬
有刺的猬 2020-11-22 03:13

I have a bitmap taken of a Base64 String from my remote database, (encodedImage is the string representing the image with Base64):

profileImage          


        
16条回答
  •  情深已故
    2020-11-22 03:58

    try this this code :

    BitmapDrawable drawable = (BitmapDrawable) imgview.getDrawable();
    Bitmap bmp = drawable.getBitmap();
    Bitmap b = Bitmap.createScaledBitmap(bmp, 120, 120, false);
    

    I hope it's useful.

提交回复
热议问题