-1
사진을 찍거나 갤러리에서 이미지를 선택해야하는 응용 프로그램을 만들어야하며 크기를 50kb로 서버에 보내야합니다.비트 맵을 50kb로 압축
지금까지 비트 맵의 너비와 높이의 크기를 조정할 수있는 코드 만 있었지만 그 덕분에 비트 맵의 품질이 떨어졌습니다.
public Bitmap getResizedBitmap(Bitmap image, int maxSize) {
int width = image.getWidth();
int height = image.getHeight();
float bitmapRatio = (float)width/(float) height;
if (bitmapRatio > 1) {
width = maxSize;
height = (int) (width/bitmapRatio);
} else {
height = maxSize;
width = (int) (height * bitmapRatio);
}
return Bitmap.createScaledBitmap(image, width, height, true);
}
미리 감사드립니다.
당신은 (https://stackoverflow.com/questions/28424942/decrease-image-size-without-losing-its-quality-in-android)이 [링크]를 시도 않았다 – Developer