コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);

            imageView = FindViewById <ImageView>(Resource.Id.imageView);

            AssignCopyrightText();
            AssignStartCameraButtonHandler();
            AssingCroppingUIButtonHandler();
            AssignApplyImageFilterButtonHandler();
            AssignImportImageButtonHandler();
            AssignCreatePdfButtonHandler();
            AssignCreateTiffButtonHandler();
            AssignOcrButtonsHandler();
            AssignWorkflowsButtonHandler();
            AssignBusinessCardButtonHandler();

            PermissionUtils.Request(this, FindViewById(Resource.Layout.Main));
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            //set connect device layout
            SetContentView(Resource.Layout.activity_take_picture);
            //xamarin essentials
            Platform.Init(this, savedInstanceState);

            //reference buttons or imageview from layout xml. camera and gallery
            Button button0 = FindViewById <Button>(Resource.Id.button0);

            button0.Click += delegate { StartActivity(typeof(MainActivity)); };

            button_capture = FindViewById <Button>(Resource.Id.button_capture);
            button_import  = FindViewById <Button>(Resource.Id.button_import);
            imageView1     = FindViewById <ImageView>(Resource.Id.imageView1);

            button_capture.Click += Button_capture_Click;
            button_import.Click  += Button_import_Click;

            int count = 0;

            if (count == 0)
            {
                RequestPermissions(permissionGroup, 0);
                PermissionUtils.Request(this, FindViewById(Resource.Layout.activity_main));
                count++;
            }

            byte[] compressedbytes = Intent.GetByteArrayExtra("bytearray");
            if (compressedbytes != null)
            {
                TakePhoto(compressedbytes);
            }
        }