3

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?

4

2 回答 2

1

您可以使用 java 代码来缩放位图图像。

  • 将位图读取为流
  • Bitmap bm = BitmapFactory.decodeStream(你缓冲的放入流);
  • bm=bm.createScaledBitmap(bm,imgwidth,imgheight,new Boolean(false));
于 2010-10-19T10:05:14.243 回答
0

您不能要求 Android 为您执行此操作。

必须以您将使用它们的尺寸创建图像。

于 2011-08-16T11:45:11.457 回答