Dear All,
For capturing a camera image, the below works fine:
But I don´t get to crop it, all the putextras for that purpose are completely ignored.
Anyway, I then tried to do this, using the location of where the image has been put and is confirmed to exist:
But this throws me an error:
If somebody knows how to get the cropping to work with the first part, why I get an exception with the 2nd one is not really important - I just need this to be solved either way.
Thanks in advance!
For capturing a camera image, the below works fine:
B4X:
Dim i As Intent
i.Initialize("android.media.action.IMAGE_CAPTURE", "")
Dim uri As Uri
i.PutExtra("crop", "true")
i.PutExtra("aspectX", 0)
i.PutExtra("aspectY", 0)
i.PutExtra("outputX", 100)
i.PutExtra("outputY", 100)
uri.Parse("file://" & File.Combine(imageFolder, tempImageFile))
i.PutExtra("output", uri)
Try
StartActivityForResult(i)
But I don´t get to crop it, all the putextras for that purpose are completely ignored.
Anyway, I then tried to do this, using the location of where the image has been put and is confirmed to exist:
B4X:
Dim uri As Uri
uri.Parse("file://" & File.Combine(imageFolder, tempImageFile ))
in.Initialize("com.android.camera.action.CROP", uri)
in.Flags = 1
in.SetType("image/*")
in.PutExtra("crop", "true")
in.PutExtra("aspectX", 1)
in.PutExtra("aspectY", 1)
uri.Parse("file://" & File.Combine(imageFolder, "tempimg2.jpg"))
in.PutExtra("output", uri)
But this throws me an error:
B4X:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.camera.action.CROP dat=(StringUri) file:///storage/emulated/0/Android/data/b4a.example4/files/tempimage.jpg typ=image/* flg=0x20001 (has extras) }
If somebody knows how to get the cropping to work with the first part, why I get an exception with the 2nd one is not really important - I just need this to be solved either way.
Thanks in advance!