CameraEnhancer
The CameraEnhancer class is the primary class of Dynamsoft Camera Enhancer that defines the camera controlling APIs. It is a subclass of ImageSourceAdapter.
Definition
Namespace: Dynamsoft.CameraEnhancer.Maui
Assembly: Dynamsoft.CameraEnhancer.Maui
class CameraEnhancer : ImageSourceAdapter
Methods
| Method | Description |
|---|---|
CameraEnhancer(CameraView cameraView) |
The constructor. Initialize the CameraEnhancer with a CameraView instance. |
CameraEnhancer |
The constructor. |
SetCameraView |
Set/get the CameraView instance that bind with this CameraEnhancer instance. |
GetCameraView |
Set/get the CameraView instance that bind with this CameraEnhancer instance. |
Open |
Open the camera. |
Close |
Close the camera. |
SetScanRegion |
Set a scan region. The video frame is cropped based on the scan region. |
GetScanRegion |
Get a scan region. |
EnableEnhancedFeatures |
Enable the specified enhanced features. View EnumEnhancedFeatures for more details. |
DisableEnhancedFeatures |
Disable the specified enhanced features. View EnumEnhancedFeatures for more details. |
SelectCamera |
Select a camera with a camera position. |
GetCameraPosition |
Select a camera with a camera position. |
SetZoomFactor |
Set the zoom factor of the camera. |
GetZoomFactor |
Get the zoom factor of the camera. |
SetFocus |
Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode. |
GetFocusMode |
Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode. |
TurnOnTorch |
Turn on the torch. |
TurnOffTorch |
Turn off the torch. |
TakePhoto |
Take a photo. |
The following methods are inherited from superclass ImageSourceAdapter
| Method | Description |
|---|---|
StartFetching |
Start fetching images from the source to the Video Buffer of ImageSourceAdapter. |
StopFetching |
Stop fetching images from the source to the Video Buffer of ImageSourceAdapter. |
SetMaximumImageCount |
Sets the maximum number of images that can be buffered at any time. |
GetMaximumImageCount |
Returns the maximum number of images that can be buffered. |
GetImageCount |
Returns the current number of images in the buffer. |
IsBufferEmpty |
Determines whether the buffer is currently empty. |
ClearBuffer |
Clears all images from the buffer, resetting the state for new image fetching. |
SetColourChannelUsageType |
Sets the usage type for color channels in images. |
GetColourChannelUsageType |
Returns the current usage type for color channels in images. |
CameraEnhancer(CameraView cameraView)
The constructor. Initialize the CameraEnhancer with a CameraView instance.
CameraEnhancer(CameraView cameraView);
Parameters
cameraView: A CameraView instance.
CameraEnhancer
The constructor.
CameraEnhancer();
SetCameraView
Bind a CameraView instance with this CameraEnhancer instance.
void SetCameraView(CameraView view);
GetCameraView
Get the CameraView object that bind to this CameraEnhancer.
CameraView GetCameraView();
Open
Open the camera.
void Open();
Close
Close the camera.
void Close();
SetScanRegion
Set a scan region. The video frame is cropped based on the scan region.
void SetScanRegion(DMRect scanRegion);
Parameters
scanRegion: A DMRect object.
GetScanRegion
Get the scan region if one has been set.
DMRect GetScanRegion();
Return Value
A DMRect object that represent the scan region area.
EnableEnhancedFeatures
Enable the specified enhanced features. View EnumEnhancedFeatures to learn about these enhanced features. By default, these enhanced features are all disabled.
void EnableEnhancedFeatures(EnumEnhancedFeatures features);
Parameters
enhancedFeatures: A combined value of EnumEnhancedFeatures which indicates a series of enhanced features.
Return Value
A bool value that indicates whether the enhanced features are enabled successfully.
DisableEnhancedFeatures
Disable any enhanced features that have been previously enabled. View EnumEnhancedFeatures to learn about these enhanced features.
void DisableEnhancedFeatures(EnumEnhancedFeatures features);
Parameters
enhancedFeatures: A combined value of EnhancedFeatures which indicates a series of enhanced features.
SelectCamera
Select a camera with a camera position.
void SelectCamera(EnumCameraPosition cameraPosition);
Parameters
cameraPosition: One of the EnumCameraPosition value.
GetCameraPosition
Get the current camera position.
EnumCameraPosition GetCameraPosition();
Return Value
A EnumCameraPosition value that represents the current camera position.
SetZoomFactor
Set the zoom factor of the camera.
void SetZoomFactor(float zoomFactor);
Parameters
zoomFactor: The zoom factor.
GetZoomFactor
Get the zoom factor of the camera.
float GetZoomFactor();
Return Value
The zoom factor.
SetFocus
Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode.
void SetFocus(Point focusPoint, EnumFocusMode subsequentFocusMode);
Parameters
focusPoint: The focus point of interest. The coordinate base of the point is “image”.
subsequentFocusMode: The subsequent focus mode of type EnumFocusMode.
GetFocusMode
Get the current focus mode.
EnumFocusMode GetFocusMode();
Return Value
A EnumFocusMode value that represents the current focus mode.
TurnOnTorch
Turn on the torch.
void TurnOnTorch();
TurnOffTorch
Turn off the torch.
void TurnOffTorch();
TakePhoto
Take a photo.
public partial void TakePhoto(Action<byte[]?> listener);
Parameters
listener: A callback to receive the photo data.