0
在内存不足的解决方案中:Strange out of memory issue while loading an image to a Bitmap object讨论了使用decodeFile(File f)。你如何处理被称为R.id.something的内部图像文件?这些资源被视为整数?Android中的OutOfMemory
在内存不足的解决方案中:Strange out of memory issue while loading an image to a Bitmap object讨论了使用decodeFile(File f)。你如何处理被称为R.id.something的内部图像文件?这些资源被视为整数?Android中的OutOfMemory
您可以使用decodeResource():
Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage);
或
Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage,options);
谢谢你,我的作品! – 2011-01-14 12:52:54