-
Grun6
I'm a bit stubborn...and I tried to build a shield view for the
take_photo()
function to callphotos.capture_image()
And @JonB you are right, capture_image() still cancels the wait_modal() call.I am willing to accept this, but question for @omz, is there a reason why
photos.capture_image()
cancels the wait_modal() call. And is there a way around it?
ThanksAI
-
-
Grun6
Hello,
I am looking for help in creating a shield view, where a
photos.capture_image()
call can be made without cancelling the wait modal call of a form dialog container view (for those familiar with the dialogs module).This is the solution used for the date picker in the dialogs module.
Here is a gist to my modified dialogs module:
https://gist.github.com/368433/312e372196880980eaa5e0867b720672I think it would have to go in the take_photo() function but I do not know how to go about it.
Any help would be much appreciated.G
-
Grun6
wow. @cvp. I don't know what to say...I've been trying to sort this out for literally three days...
Thanks so much for looking at it,
Merry Christmas,
G -
-
Grun6
Notice:
- the photo type is implemented at line 94
- the take_photo call is implemented at line 344
- the rest is pretty much the form_dialog module (I have implemented a segmented type but it has nothing to do with the rest)
It all works well, but it seems that the capture_image() call changes the self.container_view item
-
Grun6
You are right. I thought it would be long here but a gist is perfect:
https://gist.github.com/368433/043e7e00955b7f880d422d3961a79215Also you can use this code for the demo:
import PhotoDialogs fields = [{'type':'text', 'title':'First Name', 'key':'fname', 'value':''}, {'type':'photo', 'title':'ID card', 'key':'ID_photo', 'value':''}] PhotoDialogs.form_dialog(fields = fields)
Notice what happens when you press Done after a picture is taken.
-
Grun6
Hello,
I've been trying for days to do the following, and run into the same NoneType problem. Here is what I am after: in addition to entering text, numbers, checkmarks, and dates in a form dialog, I would like to also take a picture, and store it locally.
The "picture" row in the form dialog would have two buttons, one to take a picture, and one to show a preview of it. The form dialog return dictionary would return the path to the picture as the value for that given photo row.
Example:
fields = [{'type':'text', 'title':'First Name', 'key':'fname', 'value':''}, {'type':'photo', 'title':'ID card', 'key':'ID_photo', 'value':''}] dialogs.form_dialog(fields = fields)
And say the user enters "Bob" as first name, and uses the buttons to take a picture that gets stored locally at path
pictures/some_unique_id.jpeg
Then the form dialog would return:{'fname':'Bob', 'ID_photo':'pictures/some_unique_id.jpeg'}
In my attempts, I have used the photos module, the
capture_image()
function to get the image, and theimage.save(path)
function to save it.Any help would be greatly appreciated,
Merry Christmas to you all,
G -
-
Grun6
Yep I've tried but it pushes the window prompt behind the form_dialog window and makes it unusable.
Would you be willing to have a look at it, I could send you my files/github repo to run on your side.
Thanks,
G