cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bjarvis
Advocate I
Advocate I

Camera Capture Button - Camera control not selected

Hi all,

 

Most tutorials for the Camera Control have you use the Camera Controls 'OnSelect' - which means you're tapping the screen to take the photo.

 

I would much rather have a 'Capture' button at the bottom of the screen to actually capture the photo

However, it seems that to do this the camera control must be selected first, and re-selected after every press of the button 'Capture' (otherwise the image doesn't capture)

 

Currently i have a button called 'Capture' that has this code in it's On Select (image attached)

 

Collect(local_photos, Camera.Photo); UpdateContext({PhotoDateTime: Now()})

 

Is there anything i can do to make sure the camera control is selected when a user presses the button?

 

 

Capture.PNG

14 REPLIES 14

That is the issue though.  You have to stream.  You cannot do it with .Photo.

@jhall  Right...for .Photo, you are assuming someone presses the control to take a photo and capture it.  So, Camera will have a photo in the buffer to use.

If you use .Stream, you can grab a photo at any point you want.

 

So, I apologize that I am not seeing the issue here.  

Seems that if you want the user to tap the camera for a photo, then they will defintiely be selecting it.  If you want to take a photo without selecting/clicking the control, then you use the stream.  Either way gives you the photo.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Well, the main issue from the PowerApps team's perspective should be that no error is thrown and the DOCUMENTED setup does not work except in the exact manner described (clicking the photo).

 

I am unclear on the ramifications for .Stream vs. .Photo for size/transfer as I did not test yet but will tomorrow.

BrianHFASPS
Continued Contributor
Continued Contributor

If you want talk about photo size be sure to check out my other thread. https://powerusers.microsoft.com/t5/General-Discussion/Camera-resolution-defined-by-control-size-Yes... It is device dependent and in some cases control size dependent. 

I solved the issue with Select().

 

Camera OnSelect property: false

 

Button OnSelect property: Select(Camera);;ClearCollect(Collection1; Camera.Photo);;UpdateContext({PhotoDateTime: Now()})

 

When the user clicks the button, the Camera control is selected and a photo taken.

 

Update: It seems like the user still has to click the Camera control before clicking the button so Select() didn't help either I'm afraid.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,985)