보통은 1024 768 쓰고 그 위의 해상도의 경우 리사이즈해서 사용합니다.
public void resizeBitmap(String strPath){
mBitmap = BitmapFactory.decodeFile(strPath);
BitmapFactory.Options option = new BitmapFactory.Options();
if((mBitmap.getWidth() > 4000) || (mBitmap.getHeight() > 4000 ))//max width * height 4096 * 4096 (in kitkat)
{
option.inSampleSize = 2; // 1/2 크기로 축소 2의 배수단위가 처리 속도가 가장빠름
}
else
{
option.inSampleSize = 1;
}
mBitmap = BitmapFactory.decodeFile(strPath, option);
int width = mBitmap.getWidth();
int height = mBitmap.getHeight();
int newWidth = width;
int newHeight = height;
float rate = 0.5f;
int maxResolution = 4000;
if(width < height)
{
if(maxResolution < width)
{
rate = maxResolution / (float) width;
newHeight = (int) (height * rate);
newWidth = maxResolution;
}
}
else
{
if(maxResolution < height)
{
rate = maxResolution / (float) height;
newWidth = (int) (width * rate);
newHeight = maxResolution;
}
}
Bitmap resized = Bitmap.createScaledBitmap(mBitmap, newWidth, newHeight, true);
mImage.setImageBitmap(resized);
// mBitmap.recycle();
}