【问题标题】:How I can use com.android.camera.action.CROP with unspecified output size?如何使用未指定输出大小的 com.android.camera.action.CROP?
【发布时间】:2017-05-24 09:57:02
【问题描述】:

通常 com.android.camera.action.CROP 会显示设备的裁剪动作,我已经尝试过,但它需要指定的输出大小。有没有像IsseiAoki/SimpleCropView 或steelkiwi/cropiwa 等指定输出大小的最简单方法来执行裁剪操作?

Intent cropIntent = new Intent("com.android.camera.action.CROP");
cropIntent.setDataAndType(picUri, "image/*");
cropIntent.putExtra("crop", "true");
cropIntent.putExtra("outputX", 360);
cropIntent.putExtra("outputY", 360);
cropIntent.putExtra("return-data", true);
startActivityForResult(cropIntent, PIC_CROP);

【问题讨论】:

    标签: android image crop


    【解决方案1】:

    通常 com.android.camera.action.CROP 会显示设备的裁剪动作

    没有。它经常会因ActivityNotFoundException 而崩溃。 Android does not have a CROP Intent,许多 Android 设备不会附带相机应用程序或任何其他提供 com.android.camera.action.CROP 的应用程序。除此之外,com.android.camera.action.CROP 未记录在案,因此哪些额外功能受到尊重,这些额外功能意味着什么,将因活动而异。

    有没有最简单的方法可以在没有指定输出大小的情况下执行裁剪操作

    查找并使用提供所需功能集的an image-cropping library。您似乎在问题中列出了其中两个。

    【讨论】:

      猜你喜欢
      • 2012-09-27
      • 2011-04-03
      • 2011-11-11
      • 1970-01-01
      • 1970-01-01
      • 2012-04-09
      • 2014-03-16
      • 2018-02-21
      相关资源
      最近更新 更多