public void FontShapesAreRenderedCorrectlyWithAPenPatterned <TPixel>( TestImageProvider <TPixel> provider, int fontSize, int x, int y, string fontName, string text) where TPixel : struct, IPixel <TPixel> { Font font = CreateFont(fontName, fontSize); TPixel color = NamedColors <TPixel> .Black; provider.VerifyOperation( OutlinedTextDrawingComparer, img => { img.Mutate(c => c.DrawText(text, new Font(font, fontSize), null, Pens.DashDot(color, 3), new PointF(x, y))); }, $"pen_{fontName}-{fontSize}-{ToTestOutputDisplayText(text)}-({x},{y})", appendPixelTypeToFileName: false, appendSourceFileOrDescription: true); }
public static IPen GetPen(this Cmdlet cmdlet, Pen penType, float width, string colorString) { Rgba32 rgbaColor = cmdlet.ParseColor(colorString); Color color = new Color(rgbaColor); switch (penType) { case Pen.Dash: return(Pens.Dash(color, width)); case Pen.DashDot: return(Pens.DashDot(color, width)); case Pen.DashDotDot: return(Pens.DashDotDot(color, width)); case Pen.Dot: return(Pens.Dot(color, width)); default: return(Pens.Solid(color, width)); } }
/// <summary> /// Create a pen with a 'Dash Dot' drawing patterns /// </summary> /// <param name="brush">The brush.</param> /// <param name="width">The width.</param> /// <returns>The Pen</returns> public static Pen DashDot(IBrush <Color> brush, float width) => new Pen(Pens <Color> .DashDot(brush, width));
/// <summary> /// Create a pen with a 'Dash Dot' drawing patterns /// </summary> /// <param name="color">The color.</param> /// <param name="width">The width.</param> /// <returns>The Pen</returns> public static Pen DashDot(Color color, float width) => new Pen(Pens <Color> .DashDot(color, width));