public static void DrawRectangle(Context context, Orthotope2Double bounds, Krach.Graphics.Color color, bool fill) { context.Rectangle(bounds.Start.X + 0.5, bounds.Start.Y + 0.5, bounds.Size.X - 1, bounds.Size.Y - 1); context.LineWidth = 1; context.LineCap = LineCap.Butt; context.Color = Drawing.ToCairoColor(color); if (fill) { context.Fill(); } else { context.Stroke(); } }
public static void DrawText(Context context, string text, Vector2Double position, Krach.Graphics.Color color) { //context.SelectFontFace("Helvetica", FontSlant.Normal, FontWeight.Bold); context.SetFontSize(13); context.Color = Drawing.ToCairoColor(color); context.MoveTo(position.X, position.Y); context.ShowText(text); }
public static void DrawLine(Context context, Vector2Double startPoint, Vector2Double endPoint, double lineWidth, Krach.Graphics.Color color) { context.MoveTo(startPoint.X, startPoint.Y); context.LineTo(endPoint.X, endPoint.Y); context.LineWidth = lineWidth; context.LineCap = LineCap.Butt; context.Color = ToCairoColor(color); context.Stroke(); }
public static Cairo.Color ToCairoColor(Krach.Graphics.Color color) { return(new Cairo.Color(color.Red, color.Green, color.Blue, color.Alpha)); }