コード例 #1
0
ファイル: MainActivity.cs プロジェクト: BenBtg/EyeSpy
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mPreview        = FindViewById <CameraSourcePreview>(Resource.Id.preview);
            mGraphicOverlay = FindViewById <GraphicOverlay>(Resource.Id.faceOverlay);
            //greetingsText = FindViewById<TextView>(Resource.Id.greetingsTextView);

            eyeSpyAPI = new EyeSpyAPI();

            if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == Permission.Granted)
            {
                CreateCameraSource();

                /*LiveCamHelper.Init();
                 * LiveCamHelper.GreetingsCallback = (s) => { RunOnUiThread(() => GreetingsText = s); };
                 * await LiveCamHelper.RegisterFaces();*/
            }
            else
            {
                RequestCameraPermission();
            }
        }
コード例 #2
0
ファイル: MainActivity.cs プロジェクト: BenBtg/EyeSpy
 public GraphicFaceTracker(MainActivity context, GraphicOverlay overlay, CameraSource cameraSource = null)
 {
     mContext      = context;
     mOverlay      = overlay;
     mFaceGraphic  = new FaceGraphic(overlay);
     mCameraSource = cameraSource;
 }
コード例 #3
0
        public FaceGraphic(GraphicOverlay overlay) : base(overlay)
        {
            mCurrentColorIndex = (mCurrentColorIndex + 1) % COLOR_CHOICES.Length;
            var selectedColor = COLOR_CHOICES[mCurrentColorIndex];

            mFacePositionPaint = new Paint()
            {
                Color = selectedColor
            };
            mIdPaint = new Paint()
            {
                Color    = selectedColor,
                TextSize = ID_TEXT_SIZE
            };
            mBoxPaint = new Paint()
            {
                Color = selectedColor
            };
            mBoxPaint.SetStyle(Paint.Style.Stroke);
            mBoxPaint.StrokeWidth = BOX_STROKE_WIDTH;
        }
コード例 #4
0
ファイル: CameraSourcePreview.cs プロジェクト: BenBtg/EyeSpy
 public void Start(CameraSource cameraSource, GraphicOverlay overlay)
 {
     mOverlay = overlay;
     Start(cameraSource);
 }