Use scalable bitmaps for the search bar / progressbar.

I am trying to create a custom look for the search, and I created images for normal / full and thumbs. But the problem is that the images are not scaled by the android, but simply tiled / cropped. How can I ask Android to scale given images instead of cropping / cropping?

+3
source share
2 answers

You can use java code to scale bitmap images.

  •  
  • Reading a bitmap as a stream  
  • Bitmap bm = BitmapFactory.decodeStream (your stream buffered);  
  • bm = bm.createScaledBitmap(bm, imgwidth, imgheight, new Boolean (false));
+1

Android .

, .

0

Source: https://habr.com/ru/post/1770283/


All Articles