Skip to main content
10-Marble
May 18, 2022
Solved

How can I take a picture using application events from a 3D Eyewear Experience

  • May 18, 2022
  • 2 replies
  • 3665 views

Hello Everyone,

 

I am developing an experience for hololens 2 where I need to take a picture using a voice command and the way I would like to do that is using the application events because I am using those for others functions.

In that way, I am trying to write a function and call it from the application event but no success so far.

 

Any idea on that?

 

Many thanks,

Felipe Duarte

Best answer by Mohit_Kabra27

Hi @fbdsilva , 

Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve 

 

Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code

twx.app.fn.triggerWidgetService('camera-1', 'takePicture');

 

I Hope this helps, thanks 

 

BR,

Mohit 

2 replies

5-Regular Member
May 20, 2022

Hello @fbdsilva ,

 

As far I can understand from this, you want to use application event to take picture and at the same time want to call a function 

For this, you can do the below bindings: 

MK_10166888_0-1653053054311.png

Write the required function and call it as the way shown below :

MK_10166888_1-1653053185010.png

Attaching a sample project for the same, let me know if this is what you were looking for 

Best Regards,

Mohit Kabra

fbdsilva10-MarbleAuthor
10-Marble
May 23, 2022

Hi Mohit,

 

Thanks for sending this but my issue is not how to write a function and call it from an application event, I am doing that for many others functions, the issue is how to write the function to take the photo because as you sent others type of functions works fine but a take picture event is not triggered from the application event.

 

Any ideas?

 

Thanks again,

Felipe Duarte

5-Regular Member
May 23, 2022

Hi @fbdsilva , 

Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve 

 

Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code

twx.app.fn.triggerWidgetService('camera-1', 'takePicture');

 

I Hope this helps, thanks 

 

BR,

Mohit 

9-Granite
June 16, 2022

Hello @fbdsilva@Mohit_Kabra27,

 

I wanted to ask you, In my vuforia platform, application event is not showing. What should I do? Here I attach file please check this. Do you have any idea about this or anyone knows please tell me.

fbdsilva10-MarbleAuthor
10-Marble
November 8, 2022

It is because you are not connected to any Thingworx server.