Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 XML 文件中创建了一个由 12 个图像组成的帧动画。在添加到动画之前是否需要缩放每个图像,以避免内存不足错误?如果我使图像更小,我不会出错。如何缩放图像以构建动画,还是有必要这样做?我还尝试在图像视图中设置缩放。
//首先添加Scale Bitmap代码,然后使用动画。
photoBitmap = Bitmap.createScaledBitmap(bitmap, 100, 100, true); imageView.setImageBitmap(photoBitmap); // 动画代码