views:

38

answers:

1

Hi, I am trying to create a custom look for the seekbar, and I created images for normal/filled and the thumb states. But the problem is that the images are not being scaled by android, instead are just tiled/clipped. How can I ask Android to scale the given images instead of tiling/clipping?

A: 

You can use java code to scale Bitmap images.

  • Read bitmap as stream
  • Bitmap bm = BitmapFactory.decodeStream(your buffered in put stream);
  • bm=bm.createScaledBitmap(bm,imgwidth,imgheight,new Boolean(false));



Hope this will help a bit

Thanks

viv
that is the last resort. But for other UI components, say a Button, if you assign a backgroundDrawable, it scales itself to fit the actual size. How to enable this in seekbar was my concern.
Codevalley
Yes you are correct, i never tried it in seekbar, so i thought may be this work around may work.
viv