Resource Base
Table of contents

Class DCVImageEditorView

A view class for users to add editable UI elements on a static image.

class DDNXamarin.DCVImageEditorView : View

Properties Summary

Property Description
OriginalImage Set the image to display on the view.
DetectedQuadResults Set the coordinates of detected quads.

Methods Summary

Method Description
getSelectedQuadResult Get the user selected quad. It records the latest user edited information.

Properties Details

OriginalImage

Set the image to display on the view.

ImageData OriginalImage

DetectedQuadResults

Set the coordinates of detected quads.

DetectedQuadResult[] DetectedQuadResults

Methods Details

getSelectedQuadResult

Get the user selected quad. It records the latest user edited information.

Quadrilateral getSelectedQuadResult()

Code Snippet

The following code snippet shows how to use DCVImageEditorView to display image and enable users to edit quads for document normalization.

In the .xaml file, configure DCVImageEditorView and a button for triggering normalization.

<ContentPage.Content>
    <AbsoluteLayout>
        <dynamsoft:DCVImageEditorView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All"
            x:Name="imageEditor">
        </dynamsoft:DCVImageEditorView>
        <Button
            x:Name="normalize"
            Clicked="onNormalizeClicked"
            Text="Normalize"
            AbsoluteLayout.LayoutBounds="0.5,0.5,120,50"
            AbsoluteLayout.LayoutFlags="PositionProportional">
        </Button>
    </AbsoluteLayout> 
</ContentPage.Content>

In the .xaml.cs file, add the following code. You can get imageData and DetectedQuadResult[] from DetectQuad methods or IDetectResultListener

namespace DDNDemo
{
    public partial class QuadEditorPage : ContentPage
    {
        ImageData data;
        DetectedQuadResult[] results;
        public QuadEditorPage(ImageData imageData, DetectedQuadResult[] results)
        {
            InitializeComponent();
            data = imageData;
            this.results = results;
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (data != null) {
                imageEditor.OriginalImage = data;
            }
            if (results != null) {
                imageEditor.DetectedQuadResults = results;
            }
        }

        void onNormalizeClicked(object sender, EventArgs e) {
            var quad = imageEditor.getSelectedQuadResult();
            var result = App.ddn.Normalize(data, quad);
            Navigation.PushAsync(new ResultPage(result.image));
        }
    }
}

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 2.x
      • Version 2.2.10
      • Version 2.0.20
      • Version 2.0.10
      • Version 2.0.10
    • Version 1.x
      • Version 1.0.30
      • Version 1.0.21
      • Version 1.0.20
      • Version 1.0.12
      • Version 1.0.11
      • Version 1.0.10
      • Version 1.0.0
      • Version 1.0.30
      • Version 1.0.21
      • Version 1.0.20
      • Version 1.0.12
      • Version 1.0.11
      • Version 1.0.10
      • Version 1.0.0
      • Version 1.0.5
      • Version 1.0.4
      • Version 1.0.3
      • Version 1.0.2
      • Version 1.0.1
      • Version 1.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support