2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
21 namespace Tizen.NUI.BaseComponents
24 /// CameraView is a view for camera preview.
26 /// <since_tizen> 9 </since_tizen>
27 public class CameraView : View
29 /// <since_tizen> 9 </since_tizen>
30 public enum DisplayType
32 Window = 0, // HW overlay
33 Image // texture stream
37 /// Creates an initialized CameraView.
39 /// <param name="handle">Multimedia Camera handle</param>
40 /// <param name="type">DisplayType</param>
41 /// <since_tizen> 9 </since_tizen>
42 public CameraView(global::System.IntPtr handle, DisplayType type = DisplayType.Window) : this(Interop.CameraView.New(handle, (int)type), true)
44 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47 internal CameraView(CameraView cameraView) : this(Interop.CameraView.NewCameraView(CameraView.getCPtr(cameraView)), true)
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 internal CameraView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
57 /// Called when the camera view needs to be updated if the camera setting is changed.
61 /// camera = new Tizen.Multimedia.Camera(Tizen.Multimedia.CameraDevice.Front);
62 /// cameraView = new CameraView(overlayCamera.Handle);
63 /// cameraView.Size = new Size(300, 400);
64 /// camera.DisplaySettings.Rotation = Tizen.Multimedia.Rotation.Rotate90;
65 /// cameraView.Update();
68 /// <since_tizen> 9 </since_tizen>
71 Interop.CameraView.Update(SwigCPtr);
77 /// <param name="type">DisposeTypes</param>
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 protected override void Dispose(DisposeTypes type)
89 /// This will not be public opened.
90 [EditorBrowsable(EditorBrowsableState.Never)]
91 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
93 Interop.CameraView.DeleteCameraView(swigCPtr);