public override void Draw(RectangleF rect) { base.Draw(rect); using (CGContext context = UIGraphics.GetCurrentContext()) { // turn on anti-aliasing context.SetAllowsAntialiasing(true); context.ClearRect(rect); foreach (var location in locations) { drawableView.Draw( new RectangleF( new PointF( location.X - (drawableView.Size.Height / 2f), location.Y - (drawableView.Size.Width / 2f) ), drawableView.Size) ); // // context.DrawImage ( // new RectangleF ( // new PointF( // location.X - (drawableView.Size.Height / 2f), // location.Y - (drawableView.Size.Width / 2f) // ), drawableView.Size), // drawableView.CGImage); } } }
public IDisposable CreateContext() { UIGraphics.BeginImageContext(_image.Size); _context = UIGraphics.GetCurrentContext(); _context.ClearRect(new CGRect(0, 0, _image.Size.Width, _image.Size.Height)); return(new IOSTextDrawContext(_setImage)); }
public override void Draw(CGRect rect) { using (CGContext g = UIGraphics.GetCurrentContext()) { g.ClearRect(rect); this.DrawRect(g, rect, this.border.BorderThickness, this.border.BorderBrush, this.border.Background, this.border.CornerRadius); } }
public void Draw() { //get graphics context using (CGContext g = UIGraphics.GetCurrentContext()) { CGRect rect = new CGRect(x, y, w, h); g.AddEllipseInRect(rect); g.Clip(); g.ClearRect(rect); } }
public override void Draw(System.Drawing.RectangleF rect) { CGContext context = UIGraphics.GetCurrentContext(); context.ClearRect(rect); context.SetFillColor(0f, 0f); context.FillRect(rect); context.SetLineWidth(2.0f); context.SetStrokeColor(StokeColor); if (AnnotationViewModel == null) { return; } foreach (var annotation in AnnotationViewModel.Annotations) { renderer.Draw(context, annotation); } }
public void Clear(Color color) { _c.ClearRect(_c.GetClipBoundingBox()); }
public void Clear(Xamarin.Forms.Color color) { _c.ClearRect(_c.GetClipBoundingBox()); }
void drawCenter(CGContext contextRef, SizeF viewSize, PointF center) { int innerDiameter = (int)(Math.Min(viewSize.Width, viewSize.Height) - Theme.Thickness); double innerRadius = innerDiameter / 2.0; contextRef.SetLineWidth(Theme.Thickness); RectangleF innerCircle = new RectangleF((float)(center.X - innerRadius), (float)(center.Y - innerRadius), (float)innerDiameter, (float)innerDiameter); contextRef.AddEllipseInRect(innerCircle); contextRef.Clip(); contextRef.ClearRect(innerCircle); contextRef.SetFillColor(Theme.CenterColor.CGColor); contextRef.FillRect(innerCircle); }