void DrawTeamShield(Image shield) { var point = new Point(pos.X, pos.Y + ((cellArea.Height - shield.Height) / 2)); tk.DrawImage(point, shield.Width, shield.Height, shield, ScaleMode.AspectFit); pos = new Point(pos.X + shield.Width, pos.Y); remainingWidth -= shield.Width; }
void DrawTeamShield(Image shield, Color maskColor) { var point = new Point(pos.X, pos.Y + ((cellArea.Height - shield.Height) / 2)); tk.FillColor = maskColor; tk.DrawImage(point, shield.Width, shield.Height, shield, ScaleMode.AspectFit, maskColor != null); pos = new Point(pos.X + shield.Width, pos.Y); remainingWidth -= shield.Width; }
protected override void Render(Drawable window, Widget widget, Rectangle backgroundArea, Rectangle cellArea, Rectangle exposeArea, CellRendererState flags) { tk = App.Current.DrawingToolkit; this.backgroundArea = backgroundArea; this.cellArea = cellArea; this.flags = flags; using (IContext context = new CairoContext(window)) { tk.Context = context; tk.Begin(); remainingWidth = cellArea.Width; pos = new Point(cellArea.X, cellArea.Y); DrawTeamShield(homeShield); DrawTeamShield(awayShield); DrawDescription(); tk.End(); tk.Context = null; } }