Table of Contents

Class ImageCaptureView

Namespace
CapCognition.Maui.Views
Assembly
CapCognition.Maui.dll
public class ImageCaptureView : BaseView, INotifyPropertyChanged, IDynamicResourceHandler, INameScope, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, INavigationProxy, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, IBindableLayout, IPaddingElement, IVisualTreeElement, IGridLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, ICameraControlledView, IImageCaptureControlledView
Inheritance
ImageCaptureView
Implements
Inherited Members

Constructors

ImageCaptureView()

public ImageCaptureView()

Methods

CloseCamera()

Close the camera and stop the preview.

public void CloseCamera()

GetCurrentImage()

Retrieve the current image from the camera.

public SKBitmap? GetCurrentImage()

Returns

SKBitmap

The image or null if the retrieval failed

GetCurrentImageAsync(CancellationToken)

Retrieved a single image from the camera.

public Task<SKBitmap?> GetCurrentImageAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<SKBitmap>

The image or null if the retrieval failed or the cancellation token got cancelled

OnHandlerChanged()

When overridden in a derived class, should raise the HandlerChanged event.

protected override void OnHandlerChanged()

Remarks

It is the implementor's responsibility to raise the HandlerChanged event.

OnImageCaptured(SKBitmap)

public void OnImageCaptured(SKBitmap bitmap)

Parameters

bitmap SKBitmap

OpenCamera()

Open the camera and start the preview. The camera must be opened before any other operation can be performed. The caller is blocked until the camera is opened.

public bool OpenCamera()

Returns

bool

True if successfully opened

OpenCameraAsync()

Open the camera and start the preview. The camera must be opened before any other operation can be performed. Asynchronous method for smooth user experience.

public Task<bool> OpenCameraAsync()

Returns

Task<bool>

True if successfully opened

SetTorch(bool)

Set the torch on or off.

public override void SetTorch(bool on)

Parameters

on bool

True if the torch should be switched on

StartContinuousBitmapRetrieval()

Start continuous retrieval of images from the camera. The images are retrieved in the background and the ImageCaptured event is raised for each image.

public bool StartContinuousBitmapRetrieval()

Returns

bool

True if the continuous retrieval started successful

StopContinuousBitmapRetrieval()

Stop continuous retrieval of images from the camera.

public bool StopContinuousBitmapRetrieval()

Returns

bool

True if the continuous retrieval stopped successful

Terminate()

Terminate the camera and release all resources. The camera can not be opened again after this call. The view has to be created again before the camera can be opened.

public void Terminate()

Events

ImageCaptured

public event ImageCaptureView.ImageCapturedDelegate? ImageCaptured

Event Type

ImageCaptureView.ImageCapturedDelegate

InitializedEvt

public event Action? InitializedEvt

Event Type

Action