调整大小/缩放位图

时间:2013-11-16 01:50:45

标签: android bitmap resize android-canvas scale

我在onCreate中声明了几个位图。我正试图在我的onDraw中逐渐将“球”的大小从1x1增加到100x100。以下语句有效,但Eclipse当然不喜欢它。

//Avoid object allocations during draw/layout operations (preallocate and reuse instead) 
ball.set(0, Bitmap.createScaledBitmap(ball.get(0), 20, 20, true));

我正在努力避免使用精灵表。还有更好的方法吗?

感谢。

0 个答案:

没有答案