Interface IScannedPage
- Namespace
- ScanbotSDK.MAUI
- Assembly
- DocumentSDK.MAUI.dll
public interface IScannedPage : INotifyPropertyChanged
- Inherited Members
Properties
AvailablePreview
Gets the document preview if available, otherwise the original preview. Useful when data-binding.
ImageSource AvailablePreview { get; }
Property Value
DetectionStatus
Gets the detection status. May be Unknown if document detection has not yet run on the original image.
DocumentDetectionStatus DetectionStatus { get; }
Property Value
Document
Gets the document image. May be null if document detection has not yet run on the original image.
ImageSource Document { get; }
Property Value
DocumentImageSizeLimit
The maximum size of the document image. The limit will be taken into account by methods like DetectDocumentAsync() and screens like the cropping UI. By itself, setting this property has no effect on the current document image.
Size DocumentImageSizeLimit { get; set; }
Property Value
DocumentPreview
Gets the document image in a size useful for showing on screen. May be null if document detection has not yet run on the original image.
ImageSource DocumentPreview { get; }
Property Value
Filters
Gets the filter applied to the document.
ParametricFilter[] Filters { get; }
Property Value
Id
Unique identifier of the stored page. Used to reconstruct the object after custom page storage
string Id { get; }
Property Value
Original
Gets the original image, as taken by the camera.
ImageSource Original { get; }
Property Value
OriginalPreview
Gets the document image in a size useful for showing on screen.
ImageSource OriginalPreview { get; }
Property Value
Polygon
Gets the four points of the polygon that bounds the detected document. May be empty if document detection has not yet run on the original image.
Point[] Polygon { get; set; }
Property Value
- Point[]
The polygon.
Methods
DecryptedDocument()
If encryption is used, returns the decrypted document image.
Task<ImageSource> DecryptedDocument()
Returns
- Task<ImageSource>
The decrypted document async.
DecryptedDocumentPreview()
If encryption is used, returns the decrypted document preview image.
Task<ImageSource> DecryptedDocumentPreview()
Returns
- Task<ImageSource>
The decrypted document preview async.
DecryptedOriginal()
If encryption is used, returns the decrypted original image.
Task<ImageSource> DecryptedOriginal()
Returns
- Task<ImageSource>
The decrypted original image async.
DecryptedOriginalPreview()
If encryption is used, returns the decrypted original preview image.
Task<ImageSource> DecryptedOriginalPreview()
Returns
- Task<ImageSource>
The decrypted original image async.
DetectDocumentAsync()
Detects and crops the document in the original image. After completion the DetectionStatus property will contain the status of the detection and, if successful, the Document property will contain the image of the cropped document.
Task<DocumentDetectionStatus> DetectDocumentAsync()
Returns
- Task<DocumentDetectionStatus>
The status of the detection.
GetFilteredDocumentPreviewAsync(ParametricFilter)
Returns a preview of the given filter as applied to the document image.
Task<ImageSource> GetFilteredDocumentPreviewAsync(ParametricFilter filter)
Parameters
filter
ParametricFilterFilter.
Returns
- Task<ImageSource>
The filter preview async.
RemoveAsync()
Remove all image files associated with this page. After the task completes, the images in this object will no longer be valid.
Task RemoveAsync()
Returns
ResizeAsync(int)
Resizes the images of this page. The page will raise change notifications to all image properties when done.
Note:
This method will replace the page's document, but calling DetectDocumentAsync() or using the Cropping UI will override the changes, since those operations are performed on the original image, not on the resized one. For that reason, make sure to call this method after you have performed the detection, or use ScanbotOperations.ResizeImageAsync(ImageSource, int, ResultOptions) on the original image, and only then create the page, using the resized image
Task ResizeAsync(int maxSize)
Parameters
maxSize
intThe output image max size (the image will be scaled while keeping the aspect ratio; maxSize is the greater length between width and height
Returns
RotateAsync(int)
Rotates the images of this page counter-clockwise in 90 degree increments. The page will raise change notifications to all image properties when done.
Task RotateAsync(int rotations)
Parameters
rotations
intThe number of rotations to apply.
Returns
SetDocumentAsync(ImageSource)
Sets the document image of this page.
Task<ImageSource> SetDocumentAsync(ImageSource document)
Parameters
document
ImageSourceDocument image (normally external to the page file storage).
Returns
- Task<ImageSource>
An ImageSource representing the internalized document image file, same as Document.
Examples
var document = await page.SetDocumentAsync(await SBSDK.Instance.ApplyImageFilterAsync(page.Document, ParametricFilter.ColorDocument));
SetFilterAsync(ParametricFilter[])
Sets the filter to apply on the unfiltered document image. The page will raise change notifications for the Document and related properties when done.
Task<ImageSource> SetFilterAsync(ParametricFilter[] filter)
Parameters
filter
ParametricFilter[]
Returns
- Task<ImageSource>
The document image with the applied filter. Same as Document.