Skip to main content

Camera

The Camera widget is a surface that shows a live preview from the device camera on screen.
Control photo capture, video recording, flash, zoom, focus, exposure, and more from a script.

Definition and role

The Camera widget renders a live preview from the device camera. On the editing screen (design mode) it shows a placeholder; run the app and the real camera preview appears. Set the lens direction, resolution, audio, flash, and capture mode as properties, and control capture, recording, and saving from a script.

  • Category: Contents
  • Default size: fill width × height 200
  • Default capture button visibility: off (showCaptureButton = false)

Features

FeatureDescription
Live previewShows the device camera feed on screen in real time. (While the app runs)
Photo captureTakes a photo with the current camera. Trigger it from the built-in capture button or from a script.
Video recordingStarts, stops, pauses, and resumes video recording.
Camera settingsSets the lens direction, resolution, audio, flash, and capture mode as properties.
Camera controlAdjusts zoom, focus, exposure, and capture orientation lock from a script.
Save to gallerySaves captured files or base64 images to the device gallery.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the Camera item onto the canvas.
  3. In the Properties panel on the right, set the lens direction (lensFacing), resolution (resolutionPreset), capture mode (captureMode), and more.
  4. To use the built-in capture button, turn on showCaptureButton.
  5. Run the app to see the real camera preview. (The editing screen shows only a placeholder.)

Properties

PropertyDescriptionDefaultValues / type
lensFacingCamera lens direction to useback (rear)back, front
resolutionPresetPreview and capture resolutionhighlow, medium, high, veryHigh, ultraHigh, max
enableAudioWhether to include audio when recording videoOn (true)true / false
initialFlashModeInitial flash modeoffoff, auto, always, torch
captureModeCapture modephotophoto, video
showCaptureButtonWhether to show the built-in capture button over the previewOff (false)true / false

Notes and tips

warning

The real camera preview appears only when the app runs on a physical device. On the editing screen (design mode), you see just a placeholder with a camera icon and a short message.

note

Camera and storage permissions are required. On Android, saving photos and videos to the gallery requires the photo (or storage) permission.

Learn more

tip

For the complete Widget Control (Property, Method, and Event) reference for scripting this widget, see Camera Widget Control.