Select a portion of image in ImageView and retrieve the end points of selected rectangle

后端 未结 3 1103
灰色年华
灰色年华 2020-12-05 06:16

I need to drag and select a portion of an image set in an ImageView and retrieve the end points of the selected rectangle without causing any modifications (suc

3条回答
  •  盖世英雄少女心
    2020-12-05 06:47

    Another way : https://github.com/edmodo/cropper

    From the Doc:

    The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on top of the image. Calling the method getCroppedImage() will then return the Bitmap marked by the crop window.

    Developers can customize the following attributes (both via XML and programmatically):

    appearance of guidelines in the crop window whether the aspect ratio is fixed or not aspect ratio (if the aspect ratio is fixed) image resource A public method to rotate the image by a specified number of degrees is also included. This can be used to provide the user with an option to fix the image orientation should Android miscalculate the intended orientation.

    Supported on API Level 7 and above.

    For more information, see the linked Github Wiki page.

提交回复
热议问题