I have an app thats capturing two pictures from the camera.
There are two buttons and two images.
Behind each button is this code:
Button1
ClearCollect(myPhoto,myCam.Photo);
myFaceImg.Image = First(myPhoto).Url;
Button2:
ClearCollect(myID,myCam.Photo);
myIDImg.Image = First(myID).Url;
Each button should:
- clear the collection and take a picutre from the camera, placing it in the 1st slot in that particular collection.
- populate one of the images with the new photo.
I am not seeing this behavior, but am seeing a number of issues:
1. the images do not refresh each time i hit the button. they refresh the first time, then I need to select the camera control before the image will refresh via the button again.
2. The 2nd image is being populated with an image from the first collection, despite clearly being assigned an image from a different collection.
Have i misunderstood how buttons in powerapps work?
Solved! Go to Solution.
Hi @winston_smyth :
Could you tell me:
I assume the above assumption holds
First ,let me explain why you encounter the problem you mentioned.
The point is photo will not be automatically updated (and the OnSelect event of the camera control can not be triggered by other controls).
Secondly, To solve your problem, I suggest you use the stream property to automatically update the camera control’s image.
I’ve made a test for your reference:
1\Camera control(myCam):
StreamRate:
500 /*refresh rate 0.5s*/
OnStream:
true
2\Button1(pay attention: Stream instead of Photo):
OnSelect:
ClearCollect(myPhoto,myCam.Stream);
3\Button2:
OnSelect:
ClearCollect(myID,myCam.Stream);
4\image control1(myFaceImg):
Image:
First(myPhoto).Url
5\ image control1(myIDImg):
Image:
First(myID).Url
I think these links will help you a lot:
UX Patterns: Camera Shutter Button
Best Regards,
Bof
Update:
It appears that a picture cannot be captured from the camera using a button, it has to be done directly in the OnSelect of the camera.
Seems like a bug to me and makes it awkward if i want to take only a set number of pictures.
Hi @winston_smyth :
Could you tell me:
I assume the above assumption holds
First ,let me explain why you encounter the problem you mentioned.
The point is photo will not be automatically updated (and the OnSelect event of the camera control can not be triggered by other controls).
Secondly, To solve your problem, I suggest you use the stream property to automatically update the camera control’s image.
I’ve made a test for your reference:
1\Camera control(myCam):
StreamRate:
500 /*refresh rate 0.5s*/
OnStream:
true
2\Button1(pay attention: Stream instead of Photo):
OnSelect:
ClearCollect(myPhoto,myCam.Stream);
3\Button2:
OnSelect:
ClearCollect(myID,myCam.Stream);
4\image control1(myFaceImg):
Image:
First(myPhoto).Url
5\ image control1(myIDImg):
Image:
First(myID).Url
I think these links will help you a lot:
UX Patterns: Camera Shutter Button
Best Regards,
Bof
User | Count |
---|---|
254 | |
106 | |
96 | |
50 | |
39 |