public GraphicFaceTracker(int id, EventHandler <OnPictureTakenEventArgs> onPictureTaken, GraphicOverlay overlay, CameraSource cameraSource = null) { this.id = id; mOverlay = overlay; mFaceGraphic = new FaceGraphic(overlay); mCameraSource = cameraSource; this.onPictureTaken = onPictureTaken; }
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; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); FaceCameraService.CancelRequested += CancellationRequested; var b = (savedInstanceState ?? Intent.Extras); id = b.GetInt(ExtraId, 0); // Set our view from the "main" layout resource SetContentView(Resource.Layout.FaceCamera); mPreview = FindViewById <CameraSourcePreview>(Resource.Id.preview); mGraphicOverlay = FindViewById <GraphicOverlay>(Resource.Id.faceOverlay); if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == Permission.Granted) { CreateCameraSource(); } else { RequestCameraPermission(); } }
public void Start(CameraSource cameraSource, GraphicOverlay overlay) { mOverlay = overlay; Start(cameraSource); }