public override void Draw(IDrawingToolkit tk, Area area) { tk.Begin(); var center = new Point(Position.X + Width / 2, Position.Y + Height / 2); var radius = Math.Min(Width, Height) / 2; tk.FillColor = BackgroundColor; tk.StrokeColor = BackgroundColor; tk.LineWidth = 0; if (Image != null) { tk.DrawCircleImage(center, radius, Image); } else { tk.DrawCircle(center, radius); if (!String.IsNullOrEmpty(BackupText)) { tk.FontSize = (int)(radius * 1.3); tk.FontWeight = FontWeight.Bold; tk.FontAlignment = FontAlignment.Center; tk.StrokeColor = TextColor; tk.DrawText(Position, Width, Height, BackupText [0].ToString()); } } tk.End(); }
public override void Draw(IDrawingToolkit tk, Area area) { tk.Begin (); var center = new Point (Position.X + Width / 2, Position.Y + Height / 2); var radius = Math.Min (Width, Height) / 2; tk.FillColor = BackgroundColor; tk.StrokeColor = BackgroundColor; tk.LineWidth = 0; if (Image != null) { tk.DrawCircleImage (center, radius, Image); } else { tk.DrawCircle (center, radius); if (!String.IsNullOrEmpty (BackupText)) { tk.FontSize = (int)(radius * 1.3); tk.FontWeight = FontWeight.Bold; tk.FontAlignment = FontAlignment.Center; tk.StrokeColor = TextColor; tk.DrawText (Position, Width, Height, BackupText [0].ToString ()); } } tk.End (); }