我沒有解決這個錯誤成功:位圖和相機
java.lang.OutOfMemoryError: bitmap size exceeds VM budget.
我的代碼是:
BitmapFactory.Options op = new BitmapFactory.Options();
myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath(),op);
ImageView _image = (ImageView)view.findViewById(R.id.imageCarte);
int width = myBitmap.getWidth();
int height = myBitmap.getHeight();
int halfWidth = width/2;
int halfHeight = height/2;
Bitmap bmHalf = Bitmap.createScaledBitmap(myBitmap, halfWidth, halfHeight, false);
_image.setImageBitmap(bmHalf);
這個問題是轉貼:http://stackoverflow.com/questions/10460588/java-lang-的OutOfMemoryError#comment13509696_10460588。 –