Embedding photo capture in a shield view
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:
I 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.
You win't be able to use capture_image. Instead, you will need to use objc. Here is an example of a previewlayer, though I never had time to get the delegates working for taking snapshots.
which has the delegae, but not the previewlayer.
I updated the live camera view script to add a button, and take a still.
The example shows how this would be used in the context of wait_modal.
thanks for the example, I'll look into it!
I'm a bit stubborn...and I tried to build a shield view for the
take_photo()function to call
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?
but question for @omz, is there a reason why photos.capture_image() cancels the wait_modal() call. And is there a way around it?
It's likely because
wait_modalinternally checks whether the view is still on screen. When the camera UI appears full-screen, the view is moved off-screen, even though it re-appears later. That's a limitation of the
wait_modalfunction currently, and I'm not sure about the best workaround right now. I'll put this on my todo list.