카메라에서 이미지를 찍고 싶고 갤러리에서 가져간 부분도 가져 가고 싶습니다. 하나의 작업에서 다른 이미지 경로로 이미지를 가져갈 때 네 번째 이미지를 가져 오는 중 오류가 발생하여 메모리에서 오류가 발생하므로 갤러리에서 이미지를 가져오고 갤러리에서 이미지를 가져 와서 압축해야 메모리가 없어야합니다 오류 바이트 할당.갤러리에서 이미지 패스를 통해 가져 오는 동안 이미지 크기를 줄이는 방법
감사합니다.
여기 내 코드는 사람이 때문에 이미지 크기의 발생이
imageview1=(ImageView) findViewById(R.id.image1);
imageview2=(ImageView) findViewById(R.id.image2);
imageview3=(ImageView) findViewById(R.id.image3);
imageview4=(ImageView) findViewById(R.id.image4);
Bitmap b = (Bitmap) getIntent().getParcelableExtra("data") ;
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
locationname = preferences.getString("Location", "Location");
SharedPreferences preferences1 = PreferenceManager.getDefaultSharedPreferences(this);
categoryname = preferences1.getString("categoryname", "categoryname");
SharedPreferences imagepath1 = PreferenceManager.getDefaultSharedPreferences(this);
selectedImagePath1 = imagepath1.getString("picturePath1", "picturePath1");
SharedPreferences imagepath2 = PreferenceManager.getDefaultSharedPreferences(this);
selectedImagePath2 = imagepath2.getString("picturePath2", "picturePath2");
SharedPreferences imagepath3 = PreferenceManager.getDefaultSharedPreferences(this);
selectedImagePath3 = imagepath3.getString("picturePath3", "picturePath3");
SharedPreferences imagepath4 = PreferenceManager.getDefaultSharedPreferences(this);
selectedImagePath4 = imagepath4.getString("picturePath4", "picturePath4");
Bitmap thumbnail1 = (BitmapFactory.decodeFile(selectedImagePath1));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
thumbnail1.compress(Bitmap.CompressFormat.JPEG, 90, stream);
Bitmap thumbnail2 = (BitmapFactory.decodeFile(selectedImagePath2));
ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
thumbnail2.compress(Bitmap.CompressFormat.JPEG, 90, stream1);
Bitmap thumbnail3 = (BitmapFactory.decodeFile(selectedImagePath3));
ByteArrayOutputStream stream2 = new ByteArrayOutputStream();
thumbnail2.compress(Bitmap.CompressFormat.JPEG, 90, stream2);
Bitmap thumbnail4 = (BitmapFactory.decodeFile(selectedImagePath4));
ByteArrayOutputStream stream3 = new ByteArrayOutputStream();
thumbnail4.compress(Bitmap.CompressFormat.JPEG, 90, stream3);
imageview1.setImageBitmap(thumbnail1);
thumbnail1.recycle();
imageview2.setImageBitmap(thumbnail2);
imageview3.setImageBitmap(thumbnail3);
imageview4.setImageBitmap(thumbnail4);