public void TearDown()
 {
     if (Equals(TestContext.CurrentContext.Result.Outcome, ResultState.Failure))
     {
         var imageComp = new RectanglesCloud(center);
         var d         = new TagCloudVizualizer(Color.Aquamarine, Brushes.CornflowerBlue, Color.Black);
         d.Vizualize(imageComp);
     }
 }
예제 #2
0
        public Bitmap Vizualize(RectanglesCloud components)   //TODO RV(atolstov): почему бы тебе просто не возвращать битмап? Вдруг кто-то захочит отриовать его на WinForm-ах
        {
            var bitmap = new Bitmap(components.Size.Width + FrameSize, components.Size.Height + FrameSize);
            var gr     = Graphics.FromImage(bitmap);

            gr.TranslateTransform(components.Size.Width / 2 - components.Center.X, components.Size.Height / 2 - components.Center.Y);
            gr.Clear(backgroundColor);
            foreach (var rect in components.Rectangles)
            {
                gr.FillRectangle(brushForRectangles, rect);
                gr.DrawRectangle(new Pen(rectangleBordersColor), rect);
            }
            bitmap.Save(filename);
            return(bitmap);
        }
 public CircularCloudLayouter(Point center, double strainOnX = 1, double strainOnY = 1)
 {
     RectCloud = new RectanglesCloud(center);
     spiral    = new Spiral(center, strainOnX, strainOnY);
 }