Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Forma ovalada en vista superpuesta en Xamarin

Seguí esteblog para agregar una vista superpuesta en la vista previa de mi cámara.

En el fondo, se abre la vista previa de la cámara, y en la parte superior hay un rectángulo exterior superpuesto (en color fucsia) y una forma de círculo en el interior.

Hay dos formas Circle & Heart . Quiero agregar Oval .

Agregué Oval, pero no funcionó.

OverlayView.cs

 public enum OverlayShape { Circle, Heart, Oval }
 public static readonly BindableProperty ShapeProperty = BindableProperty.Create( propertyName: nameof(Shape), returnType: typeof(CameraOverlayShape), declaringType: typeof(CameraOverlayView), defaultValue: CameraOverlayShape.Oval, defaultBindingMode: BindingMode.TwoWay);

NativeOverlayView.cs

 OverlayShape overlayShape = OverlayShape.Oval; public OverlayShape Shape { get { return overlayShape; } set { overlayShape = value; Redraw(); } }
 Paint paint = new Paint(PaintFlags.AntiAlias) { Color = OverlayBackgroundColor, Alpha = (int)(255 * Opacity) }; RectF outerRectangle = new RectF(0, 0, width, height); osCanvas.DrawRect(outerRectangle, paint);
 switch (Shape) { case OverlayShape.Oval: osCanvas.DrawOval(outerRectangle, paint); break; default: // Code }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El siguiente código funciona de mi lado.

 case OverlayShape.Oval: shapeHeight = (float)(shapeHeight * 0.8); RectF rect = new RectF(width / 2- shapeWidth / 2, height / 2 - shapeHeight / 2, shapeWidth/2+ width/2 , shapeHeight/2+height/2); osCanvas.DrawOval(rect, paint); break;

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!