public void EatPie() { var a = DrawingUtils.DisplayPie(_i); _graphics.FillPie(DrawingUtils.BackBrush, R, a[0], a[1]); _i = (_i + 1) % 8; }
public static void DrawRange(int left, int right, PictureBox pb, Color clr) { Graphics g = pb.CreateGraphics(); left = DrawingUtils.LeftRelativePos(left); right = DrawingUtils.RightRelativePos(right); g.DrawRectangle(DrawingUtils.DrawingPen(clr), left, 0, 1, pb.Height); g.DrawRectangle(DrawingUtils.DrawingPen(clr), right, 0, 1, pb.Height); Thread.Sleep(12 * (Speed - DrawingUtils.Speed)); }
public void PointsAround() { var a = DrawingUtils.GetCircleAroundCenter(new Point(X, Y)); for (int j = 0; j < a.Length - 1; ++j) { _graphics.FillEllipse(Brushes.Blue, a[_i].X, a[_i].Y, 3, 3); _i = (_i + 1) % a.Length; } _i = (_i + 1) % a.Length; }
public HoareSort(PictureBox pb) { _pictureBox = pb; Random rnd = new Random(); _elements = new TheElement[DrawingUtils.MaxN]; for (int i = 0; i < _elements.Length; ++i) { var tmp = rnd.Next(1, 100); _elements[i] = new TheElement( DrawingUtils.ElemetPosition(i, tmp, pb.Height), tmp, pb); } }
public void Clear() { _pictureBox.CreateGraphics().FillRectangle(DrawingUtils.DrawingBrush(DrawingUtils.BackColor), 0, 0, _pictureBox.Width, _pictureBox.Height); }