示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            ScanPages = new List <ScanPage>();
            base.OnCreate(savedInstanceState);
            try
            {
                SupportActionBar.SetHomeButtonEnabled(true);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                SetContentView(Resource.Layout.demo_activity_document_scan_view_ui);

                Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);

                documentScanViewUI = FindViewById <DocumentScanViewUI>(Resource.Id.document_scan_view_ui);
                // initialize the documentScanViewConfig from a scan-view config file:
                DocumentScanViewConfig documentScanViewConfig = new DocumentScanViewConfig(this, "document_scan_view_config.json");

                documentScanViewUI.Init(LICENSE_KEY, documentScanViewConfig, "document_view_config.json", savedInstanceState);
                documentScanViewUI.SetDocumentScanViewListener(this);

                _isInitialized = true;
            }
            catch (Exception e)
            {
                Util.ShowError(e.ToString(), this);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.demo_activity_crop_view_ui);

            // corners and the fullImageFilePath are required parameters for cropViewUI - calling activity has to pass it:
            IList <PointF> corners           = DocScanUIMainActivity.CornersForCropUI;
            string         fullImagefilePath = Intent.Extras.GetString(DocScanUIMainActivity.EXTRA_FULL_IMAGE_PATH);

            // initialize the documentScanViewConfig from a scan-view config file:
            DocumentScanViewConfig documentScanViewConfig = new DocumentScanViewConfig(this, "document_scan_view_config.json");

            // init the cropViewUI from the layout file:
            cropViewUI = FindViewById <CropViewUI>(Resource.Id.crop_document_view_new);

            cropViewUI.Init(documentScanViewConfig, fullImagefilePath, corners, savedInstanceState);
            cropViewUI.SetCropViewUIListener(this);
        }