Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Camera"/> class.
        /// </summary>
        /// <param name="device">The camera device to access.</param>
        /// <exception cref="ArgumentException">Invalid CameraDevice type.</exception>
        /// <exception cref="NotSupportedException">The camera feature is not supported.</exception>
        /// <since_tizen> 3 </since_tizen>
        /// <feature> http://tizen.org/feature/camera </feature>
        public Camera(CameraDevice device)
        {
            Native.Create(device, out _handle).ThrowIfFailed("Failed to create camera instance");

            Capabilities    = new CameraCapabilities(this);
            Settings        = new CameraSettings(this);
            DisplaySettings = new CameraDisplaySettings(this);

            RegisterCallbacks();

            SetState(CameraState.Created);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Camera"/> class.
        /// </summary>
        /// <param name="device">The camera device to access.</param>
        /// <exception cref="ArgumentException">Invalid CameraDevice type.</exception>
        /// <exception cref="NotSupportedException">The camera feature is not supported.</exception>
        /// <since_tizen> 3 </since_tizen>
        /// <feature> http://tizen.org/feature/camera </feature>
        public Camera(CameraDevice device)
        {
            if (!Features.IsSupported(CameraFeatures.Camera))
            {
                throw new NotSupportedException("Camera feature is not supported.");
            }

            Native.Create(device, out _handle).ThrowIfFailed("Failed to create camera instance");

            Capabilities    = new CameraCapabilities(this);
            Settings        = new CameraSettings(this);
            DisplaySettings = new CameraDisplaySettings(this);

            RegisterCallbacks();

            SetState(CameraState.Created);
        }