Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Embedding photo capture in a shield view
-
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
-
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.
https://github.com/jsbain/objc_hacks/blob/master/live_camera_view.py
or see
ttps://forum.omz-software.com/topic/3665/capturing-photos-without-the-ios-screen/2
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 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 said:
but question for @omz, is there a reason why photos.capture_image() cancels the wait_modal() call. And is there a way around it?
ThanksIt's likely because
wait_modal
internally 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 thewait_modal
function currently, and I'm not sure about the best workaround right now. I'll put this on my todo list.