private class SaveOutput implements Job<Intent> {
        private final RectF mCropRect;        public SaveOutput(RectF cropRect) {
            mCropRect = cropRect;
        }        public Intent run(JobContext jc) {
            RectF cropRect = mCropRect;
            Bundle extra = getIntent().getExtras();            Rect rect = new Rect(
                    Math.round(cropRect.left), Math.round(cropRect.top),
                    Math.round(cropRect.right), Math.round(cropRect.bottom));            Intent result = new Intent();
            result.putExtra(KEY_CROPPED_RECT, rect);
            Bitmap cropped = null;
            boolean outputted = false;
            if (extra != null) {
                Uri uri = (Uri) extra.getParcelable(MediaStore.EXTRA_OUTPUT);
                if (uri != null) {
                    if (jc.isCancelled()) return null;
                    outputted = true;
                    cropped = getCroppedImage(rect);
                    if (!saveBitmapToUri(jc, cropped, uri)) return null;
                }
                if (extra.getBoolean(KEY_RETURN_DATA, false)) {
                    if (jc.isCancelled()) return null;
                    outputted = true;
                    if (cropped == null) cropped = getCroppedImage(rect);
                    result.putExtra(KEY_DATA, cropped);
                }
                if (extra.getBoolean(KEY_SET_AS_WALLPAPER, false)) {
                    if (jc.isCancelled()) return null;
                    outputted = true;
                    if (cropped == null) cropped = getCroppedImage(rect);
                    if (!setAsWallpaper(jc, cropped)) return null;
                }
            }
            if (!outputted) {
                if (jc.isCancelled()) return null;
                if (cropped == null) cropped = getCroppedImage(rect);
                Uri data = saveToMediaProvider(jc, cropped);
                if (data != null) result.setData(data);
            }
            return result;
        }
    }
看到了么?
根据你发起的时候的参数,会返回不同的值,默认返回下面:
                Uri data = saveToMediaProvider(jc, cropped);
                if (data != null) result.setData(data);你可以上android源码里面的CropImage.java这个类里面看看

解决方案 »

  1.   

    额,SDK里面android类都是jar文件,android源码怎么看呢?要单独下载吗?
      

  2.   

    Android所有版本在线源代码:
    http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android/2.0_r1/
      

  3.   

    Android所有版本在线源代码:
    http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
      

  4.   

    我觉得按照你给的应该是返回uri,可是实际返回的是bitmap,是怎么回事呢?
    我看这个例子里面也是把返回的作为bitmap,http://www.apkbus.com/android-52710-1-1.html
      

  5.   

    得到的data就是bitmap,把bitmap存成文件就行了
      

  6.   

    我觉得调用系统的裁剪,可以自己传个Uri过去吧。
    比如你想把裁剪后的图片存到/mnt/sdcard/test/crop_xxx.jpg
    那么
    File file = new File("/mnt/sdcard/test/crop_xxx.jpg");
    Uri uri = Uri.fromFile(file);启动crop程序的时候,你再把这个uri作为参数传过去
    key为MediaStore.EXTRA_OUTPUT