Android Bitmap OOM处理

    public
int calculateInSampleSize(BitmapFactory.Options option, int rWidth, int rHeight) {

        final
int width = option.outWidth;

        final
int height = option.outHeight;

        option.inSampleSize = 1;

 

        while ((height / option.inSampleSize) > rHeight || (width / option.inSampleSize) > rWidth) {

            option.inSampleSize *= 2;

        }

        return option.inSampleSize;

    }

上一篇:centos 下修改mysql 默认字符集


下一篇:bzoj1648 [Usaco2006 Dec]Cow Picnic 奶牛野餐