我正在使用这个示例来裁剪从图库中选择的图像,但问题在于该示例仅裁剪正方形。是否有可能裁剪矩形而不仅仅是正方形?在该示例中,如果我移动一侧,相邻的一侧也会移动,使其保持为正方形选择。
谢谢。
谢谢。
我发现可以使用内置的Android裁剪处理程序(com.android.camera.action.CROP)来裁剪矩形。如果要裁剪矩形,则需要删除我之前传递的示例中的以下参数:
intent.putExtra("outputX", 200); //Set this to define the max size of the output bitmap
intent.putExtra("outputY", 200); //Set this to define the max size of the output bitmap
intent.putExtra("aspectX", 1); //Set this to define the X aspect ratio of the shape
intent.putExtra("aspectY", 1); //Set this to define the Y aspect ratio of the shape
设置aspectX和aspectY将会在您移动其中之一时强制Android同时移动形状的两侧。注释掉这些行,您就可以自由移动形状了。