Class Camera
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.Camera.dll
This camera class provides methods to capture photos and supports setting up notifications for state changes of capturing, previewing, focusing, and informing about the resolution and the binary format, and functions for picture manipulations like sepia, negative, and many more. It also notifies you when a significant picture parameter changes, (For example, focus).
C#
Copy
public class Camera : IDisposable
- Inheritance
-
objectCamera
- Implements
-
System.
IDisposable
Constructors
Declaration
C#
Copy
public Camera()
Remarks
If Camera
(User can check whether CameraDeviceManager is supported or not by using Is
But, if not, this constructor will try to create Camera instance with Camera
Exceptions
Type | Condition |
---|---|
System. |
There's no available camera device.
-or- |
System. |
The camera feature is not supported. |
See Also
Declaration
C#
Copy
public Camera(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
Camera |
device | The camera device to access. |
Exceptions
Type | Condition |
---|---|
System. |
Invalid CameraDevice type. |
System. |
In case of any invalid operations. |
System. |
The camera feature is not supported. |
Properties
Declaration
C#
Copy
public int CameraCount { get; }
Property Value
Type | Description |
---|---|
int | This returns 2, if the device supports primary and secondary cameras. Otherwise 1, if the device only supports primary camera. |
Exceptions
Type | Condition |
---|---|
System. |
The camera has already been disposed. |
Declaration
C#
Copy
public CameraCapabilities Capabilities { get; }
Property Value
Type | Description |
---|---|
Camera |
Declaration
C#
Copy
public CameraFacingDirection Direction { get; }
Property Value
Type | Description |
---|---|
Camera |
A Camera |
Exceptions
Type | Condition |
---|---|
System. |
The camera has already been disposed. |
Display
Sets or gets the display type and handle to show preview images. The camera must be in the Created state.
Declaration
C#
Copy
public Display Display { get; set; }
Property Value
Type | Description |
---|---|
Display |
Remarks
This must be set before the StartPreview() method. In custom ROI display mode, DisplayRoiArea property must be set before calling this method.
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
DisplayReuseHint
The hint for the display reuse. If the hint is set to true, the display will be reused when the camera device is changed with the ChangeDevice method.
Declaration
C#
Copy
public bool DisplayReuseHint { get; set; }
Property Value
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
An invalid state. |
System. |
The camera has already been disposed. |
Declaration
C#
Copy
public CameraDisplaySettings DisplaySettings { get; }
Property Value
Type | Description |
---|---|
Camera |
Declaration
C#
Copy
public IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
System. |
Declaration
C#
Copy
public CameraSettings Settings { get; }
Property Value
Type | Description |
---|---|
Camera |
Declaration
C#
Copy
public CameraState State { get; }
Property Value
Type | Description |
---|---|
Camera |
None, Created, Preview, Capturing, Captured. |
Exceptions
Type | Condition |
---|---|
System. |
The camera has already been disposed. |
Methods
Declaration
C#
Copy
public void ChangeDevice(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
Camera |
device | The hardware camera to access. |
Remarks
If display reuse is set using Display
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
In case of any invalid operations. |
System. |
In case of the ChangeDevice feature is not supported. |
System. |
The camera has already been disposed. |
Declaration
C#
Copy
public void Dispose()
Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Declaration
C#
Copy
protected ~Camera()
Declaration
C#
Copy
public static CameraDeviceState GetDeviceState(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
Camera |
device | The device to get the state. |
Returns
Type | Description |
---|---|
Camera |
Returns the state of the camera device. |
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
Declaration
C#
Copy
public static CameraFlashState GetFlashState(CameraDevice device)
Parameters
Type | Name | Description |
---|---|---|
Camera |
device | The device to get the state. |
Returns
Type | Description |
---|---|
Camera |
Returns the flash state of the camera device. |
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
StartCapture()
Starts capturing of still images.
EventHandler must be set for capturing using Capturing
and for completed using Capture
Declaration
C#
Copy
public void StartCapture()
Remarks
This function causes the transition of the camera state from capturing to captured
automatically and the corresponding EventHandlers will be invoked.
The preview should be restarted by calling the Start
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
StartCapture(int, int, CancellationToken)
Starts continuously capturing still images.
EventHandler must be set for capturing using Capturing
and for completed using Capture
Declaration
C#
Copy
public void StartCapture(int count, int interval, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
int | count | The number of still images. |
int | interval | The interval of the capture(milliseconds). |
System. |
cancellationToken | The cancellation token to cancel capturing. |
Remarks
If this is not supported, zero shutter lag occurs. The capture resolution could be
changed to the preview resolution. This function causes the transition of the camera state
from capturing to captured automatically and the corresponding Eventhandlers will be invoked.
Each captured image will be delivered through Eventhandler set using the Capturing event.
The preview should be restarted by calling the Start
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
See Also
Declaration
C#
Copy
public void StartFaceDetection()
Remarks
This should be called after Start
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
StartFocusing(bool)
Starts camera auto-focusing, asynchronously. The camera must be in the Preview or the Captured state.
Declaration
C#
Copy
public void StartFocusing(bool continuous)
Parameters
Type | Name | Description |
---|---|---|
bool | continuous | Continuous auto focus. |
Remarks
If continuous status is true, the camera continuously tries to focus.
Exceptions
Type | Condition |
---|---|
System. |
In case of invalid parameters. |
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
StartPreview()
Starts capturing and drawing preview frames on the screen.
The display property must be set using Display before using this method.
If needed set fps Preview
Declaration
C#
Copy
public void StartPreview()
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
Declaration
C#
Copy
public void StopFaceDetection()
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
StopFocusing()
Stops camera auto focusing. The camera must be in the Preview or the Captured state.
Declaration
C#
Copy
public void StopFocusing()
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
StopPreview()
Stops capturing and drawing preview frames on the screen. The camera must be in the Preview state.
Declaration
C#
Copy
public void StopPreview()
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
The camera has already been disposed. |
System. |
In case of access to the resources cannot be granted. |
Events
Declaration
C#
Copy
public event EventHandler<EventArgs> CaptureCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><System. |
Declaration
C#
Copy
public event EventHandler<CameraCapturingEventArgs> Capturing
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
Declaration
C#
Copy
public static event EventHandler<CameraDeviceStateChangedEventArgs> DeviceStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
Exceptions
Type | Condition |
---|---|
System. |
In case of any invalid operations. |
System. |
In case of this feature is not supported. |
System. |
In case of invalid parameters. |
Declaration
C#
Copy
public event EventHandler<CameraErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
Declaration
C#
Copy
public event EventHandler<ExtraPreviewEventArgs> ExtraPreview
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Extra |
Declaration
C#
Copy
public event EventHandler<FaceDetectedEventArgs> FaceDetected
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Face |
Declaration
C#
Copy
public event EventHandler<CameraFocusStateChangedEventArgs> FocusStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
HdrCaptureProgress
An event that occurs when there is a change in the HDR capture progress.
Checks whether the Is
Declaration
C#
Copy
public event EventHandler<HdrCaptureProgressEventArgs> HdrCaptureProgress
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Hdr |
Exceptions
Type | Condition |
---|---|
System. |
In case of HDR feature is not supported. |
Declaration
C#
Copy
public event EventHandler<CameraInterruptedEventArgs> Interrupted
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
InterruptStarted
An event that occurs when the camera interrupt is started by the policy.
Declaration
C#
Copy
public event EventHandler<CameraInterruptStartedEventArgs> InterruptStarted
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |
MediaPacketPreview
An event that occurs once per frame when previewing. Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke.
Declaration
C#
Copy
public event EventHandler<MediaPacketPreviewEventArgs> MediaPacketPreview
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Media |
Preview
An event that occurs once per frame when previewing. Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke.
Declaration
C#
Copy
public event EventHandler<PreviewEventArgs> Preview
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Preview |
Declaration
C#
Copy
public event EventHandler<CameraStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Camera |