CameraView

The CameraView class is the NUI view that displays camera.

Create a CameraView

The following basic example shows how to create a CameraView object:

Figure: Basic CameraView

Basic CameraView

  1. To use the CameraView class, add the following namespaces:

    C#
    Copy
    using Tizen.NUI; using Tizen.NUI.BaseComponents;
  2. To create a CameraView, you need a handle of Tizen.Multimedia.Camera:

    C#
    Copy
    Tizen.Multimedia.Camera camera = new Tizen.Multimedia.Camera(Tizen.Multimedia.CameraDevice.Front); CameraView cameraView = new CameraView(camera.Handle); cameraView.WidthResizePolicy = ResizePolicyType.FillToParent; cameraView.HeightResizePolicy = ResizePolicyType.DimensionDependency; Window.Instance.Add(cameraView); camera.StartPreview();
    Note

    You need to control the Tizen.Multimedia.Camera class, since the CameraView does not control the same.

  3. To change display, you can choose the display type, DisplayType.Window or DisplayType.Image:

    C#
    Copy
    Tizen.Multimedia.Camera camera = new Tizen.Multimedia.Camera(Tizen.Multimedia.CameraDevice.Front); CameraView cameraView = new CameraView(camera.Handle, CameraView.DisplayType.Image); Window.Instance.Add(cameraView);
    Note

    The default display type is DisplayType.Window.

CameraView methods

When the camera display setting changes, to update the CameraView, you must call the Update() method:

C#
Copy
camera.DisplaySettings.Rotation = Tizen.Multimedia.Rotation.Rotate90; cameraView.Update();
  • Dependencies
    • Tizen 6.5 and Higher
Button
Next CheckBox
Submit your feedback to GitHub