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