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
-
To use the
CameraView
class, add the following namespaces:C#Copyusing Tizen.NUI; using Tizen.NUI.BaseComponents;
-
To create a
CameraView
, you need a handle of Tizen.Multimedia.Camera:C#CopyTizen.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 theCameraView
does not control the same. -
To change display, you can choose the display type,
DisplayType.Window
orDisplayType.Image
:C#CopyTizen.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#Copycamera.DisplaySettings.Rotation = Tizen.Multimedia.Rotation.Rotate90; cameraView.Update();
Related information
- Dependencies
- Tizen 6.5 and Higher
Submit your feedback to GitHub