Working with Widgets > 2D > Camera
What Does This Widget Do?
Allows you to take a picture in a 2D Eyewear or Mobile experience.
When Should I Use This Widget?
Use the Camera widget when you want to enable users to take a picture during an experience.
Are There Any Special Properties, Services, Events, or Actions?
To view a list of common widget properties, services, and events, see Common Widget Properties, Services, and Events.
The following table is a list of properties that are specific to this widget.
Hide 3D Augmentations
When selected, 3D augmentations in the experience are hidden.
Image Data
A base64-encoded string (text) of the resulting JPEG image taken by the camera.
Image URL
Wraps the image data above into a hyperlink which can be embedded in a web page, or bound as the Resource of a 3D Image widget.
Take Picture
Invoking this service will start the camera to take a picture.
Picture Taken
Triggered when the picture is taken.
User Canceled
Triggered when a user cancels the camera.
The Widget in Action
Here’s an example of what your widget might look like.
Minimum Steps Required for Use
1. From the 2D canvas of a 2D eyewear or mobile project, drag and drop a Camera widget onto the canvas.
2. Drag and drop a Button widget onto the canvas.
3. Enter the text you want displayed on the button. For example, Take Picture.
4. Drag and drop the icon next to Click event of the Button onto camera-1 in the project tree.
5. Select Take Picture on the Select Binding Target window and click Bind.
6. Drag and drop a Image widget onto the canvas
7. Drag and drop the Image URL property of the Camera widget onto the Image widget. Select Resource on the Select Binding Target window and click Bind.
Once you’ve completed steps 1-5, you can optionally implement the following steps.
1. Bind the Image URL property of the Camera widget to a Image widget. Select Resource as the binding target.
2. Bind the Image Data property of the Camera widget into the ThingWorx services to store the images.