to crop image,you can use IntentI saw many code about crop picture in forum
Some code have problem with permission and some code have some problem other
Please give me code for crop that working in all device
Sub cropPicture(Directory As String, PictureName As String, PictureName2 As String)
Dim i As Intent
i.Initialize("com.android.camera.action.CROP","")
i.SetType("image/*")
i.SetComponent(ParseUri("file://" & File.Combine(Directory, PictureName)))
i.PutExtra("crop", "true")
i.PutExtra("aspectX", 1)
i.PutExtra("aspectY", 1)
i.PutExtra("output", ParseUri("file://" & File.Combine(Directory, PictureName2)))
StartActivity(i)
End Sub
Can i use InternalDir in crop?to crop image,you can use Intent
B4X:Sub cropPicture(Directory As String, PictureName As String, PictureName2 As String) Dim i As Intent i.Initialize("com.android.camera.action.CROP","") i.SetType("image/*") i.SetComponent(ParseUri("file://" & File.Combine(Directory, PictureName))) i.PutExtra("crop", "true") i.PutExtra("aspectX", 1) i.PutExtra("aspectY", 1) i.PutExtra("output", ParseUri("file://" & File.Combine(Directory, PictureName2))) StartActivity(i) End Sub
I need for crop not shareThis code will not work once you set targetSdkVersion to 26. You need to use file provider to share a file uri.
There are ways to do thisI need for crop not share
What way or source i use for crop? Please
For crop avatar picture and i need user can crop itThere are ways to do this
But it may not work in different places
Exactly where you want to use?
Erel i attach my module that i use in my appsThis code will not work once you set targetSdkVersion to 26. You need to use file provider to share a file uri.
I use CropImageView library finallyThe intent based code relies on the device installed apps. It can work one some and fail on others. There isn't anything that you can do about it.