public override void Render(RenderArgs args) { var prot = args.Prototype; var context = args.Context; var bounds = args.Bounds; var fg = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value); var bg = Ressources.GetBrush((Color)prot.Parameter["BackColor"].Value); if (bg != null) { context.FillEllipse( new Ellipse( new Vector2(bounds.X + bounds.Width * 0.5f, bounds.Y + bounds.Height * 0.5f), bounds.Width * 0.5f, bounds.Height * 0.5f), bg); } if (fg != null) { context.DrawEllipse( new Ellipse( new Vector2(bounds.X + bounds.Width * 0.5f, bounds.Y + bounds.Height * 0.5f), bounds.Width * 0.5f, bounds.Height * 0.5f), fg); } }
public override void Render(RenderArgs args) { var prot = args.Prototype; var context = args.Context; var bounds = args.Bounds; var x2 = prot.Parameter.ContainsKey("X2") ? (ScreenPos)prot.Parameter["X2"].Value : new ScreenPos(); var y2 = prot.Parameter.ContainsKey("Y2") ? (ScreenPos)prot.Parameter["Y2"].Value : new ScreenPos(); var fg = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value); if (fg != null) { context.DrawLine(bounds.TopLeft, new Vector2(args.Transform(x2, false), args.Transform(y2, true)), fg); } }
public override void Render(RenderArgs args) { var prot = args.Prototype; var context = args.Context; var bounds = args.Bounds; var text = prot.Parameter["Text"].Value as String; var align = prot.Parameter.ContainsKey("Align") ? (Align)prot.Parameter["Align"].Value : Align.Left; var valign = prot.Parameter.ContainsKey("Valign") ? (Valign)prot.Parameter["Valign"].Value : Valign.Top; var size = prot.Parameter.ContainsKey("FontSize") ? (ScreenPos)prot.Parameter["FontSize"].Value : new ScreenPos(); var fg = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value); //var bg = Ressources.GetBrush((string)prot.Parameter["BackColor"].Value); var format = Ressources.GetFormat(args.Transform(size, true), align, valign); if (fg != null && text != null) { context.DrawText(text, format, bounds, fg); } }
public override void Render(RenderArgs args) { var prot = args.Prototype; var context = args.Context; var bounds = args.Bounds; var fg = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value); var bg = Ressources.GetBrush((Color)prot.Parameter["BackColor"].Value); var bw = (double)prot.Parameter["LineWidth"].Value; if (bg != null) { context.FillRectangle(bounds, bg); } if (fg != null) { context.DrawRectangle(bounds, fg, (float)bw); } }