public void TearDown() { if (TestContext.CurrentContext.Result.Outcome.Status != TestStatus.Failed) { return; } var path = $"{TestContext.CurrentContext.TestDirectory}\\{TestContext.CurrentContext.Test.FullName}.png"; Visualizer.GetImageFromRectangles(rectangles, canvasSize).Save(path); Console.WriteLine($"Tag cloud visualization saved to file {path}"); }
public static void Main() { var layouter = new CircularCloudLayouter(new Point(500, 500)); var rectangles = new List <Rectangle>(); var rand = new Random(Guid.NewGuid().GetHashCode()); for (int i = 0; i < 250; i++) { rectangles.Add(layouter.PutNextRectangle(new Size(rand.Next(WIDTH_MIN, WIDTH_MAX), rand.Next(HEIGHT_MIN, HEIGHT_MAX)))); } Visualizer.GetImageFromRectangles(rectangles, new Size(1000, 1000)).Save("out.png"); }