楼主要的是不是这种功能http://blog.csdn.net/guolin_blog/article/details/11100327

解决方案 »

  1.   

    图片的局部解析不是很难,网上也有很多例子。还有,我不记得系统图片都有什么功能,但是我知道android系统图库是有源代码的,如果有你要的功能可以参考一下源代码。
      

  2.   

    这篇文章的功能基本实现了,主要是要实现放大图片,保证图片质量并不能OOM的功能
      

  3.   

    你把图片放到一个固定大小的layout里。设置图片的模式为fix:imageView.setScaleType(ImageView.ScaleType.FIT_XY);
      

  4.   

    这篇文章的功能基本实现了,主要是要实现放大图片,保证图片质量并不能OOM的功能楼主仔细看看,他那个缩放不是decode的,所以不会oom的
      

  5.   

    这篇文章的功能基本实现了,主要是要实现放大图片,保证图片质量并不能OOM的功能楼主仔细看看,他那个缩放不是decode的,所以不会oom的
    我用了一张近4000*4000分辨率的图片还是内存溢出了
      

  6.   

    那肯定不行,4000 * 4000 decode出来有多少m了
    很大很大了。4000 * 4000 要先进行缩放处理才行
      

  7.   

    对啊,就是要缩放,但是我就是想放大的时候能够保证质量,不知道怎么实现了。另外,如果放大到原图大小,那不还是会OOM吗?
      

  8.   


    public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId,  
            int reqWidth, int reqHeight) {  
        // 第一次解析将inJustDecodeBounds设置为true,来获取图片大小  
        final BitmapFactory.Options options = new BitmapFactory.Options();  
        options.inJustDecodeBounds = true;  
        BitmapFactory.decodeResource(res, resId, options);  
        // 调用上面定义的方法计算inSampleSize值  
        options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);  
        // 使用获取到的inSampleSize值再次解析图片  
        options.inJustDecodeBounds = false;  
        return BitmapFactory.decodeResource(res, resId, options);  
    }  public static int calculateInSampleSize(BitmapFactory.Options options,  
            int reqWidth, int reqHeight) {  
        // 源图片的高度和宽度  
        final int height = options.outHeight;  
        final int width = options.outWidth;  
        int inSampleSize = 1;  
        if (height > reqHeight || width > reqWidth) {  
            // 计算出实际宽高和目标宽高的比率  
            final int heightRatio = Math.round((float) height / (float) reqHeight);  
            final int widthRatio = Math.round((float) width / (float) reqWidth);  
            // 选择宽和高中最小的比率作为inSampleSize的值,这样可以保证最终图片的宽和高  
            // 一定都会大于等于目标的宽和高。  
            inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;  
        }  
        return inSampleSize;  
    }  
    只能先缩放变小,要不然decode只能是oom,然后放大再用那个方法