コード例 #1
0
        public static void DrawNothing()
        {
            var canvas = new TxtDrawingCanvas(new Size(10, 10));

            using var writer = new StringWriter();
            canvas.Write(writer);
            Assert.AreEqual("", writer.ToString());
        }
コード例 #2
0
        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());
        }