public static void DrawNothing() { var canvas = new TxtDrawingCanvas(new Size(10, 10)); using var writer = new StringWriter(); canvas.Write(writer); Assert.AreEqual("", writer.ToString()); }
private static string DrawText(string txt, RectangleF bounds, StringFormatEx format = null) { var canvas = new TxtDrawingCanvas(new Size(10, 10), "\n"); canvas.DrawString(txt, null, null, bounds, format ?? StringFormatEx.GetGenericDefault); using var writer = new StringWriter(); canvas.Write(writer); return(writer.ToString()); }