Using java code to realize image clipping function in Android
•
Android
Preface Android applications often encounter the need to upload album pictures. Here is a record of how to select and cut album pictures.
Photo album select pictures 1. Activate photo album or file manager to obtain photos. The code is as follows:
2. Through the startactivityforresult() method, we can obtain the URI of the picture in onactivityresult(), and then pass the URI of the picture to the picture clipping function. The code is as follows:
3. In onactivityresult, you can get the bitmap after image clipping through data. Getparcelableextra ("data"), and then assign the bitmap to the image control.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码