public void CenterSquareCreator(FoxDraw drawer, int size, Color color) { Point coord = new Point(canvas.Height / 2, canvas.Width / 2); List <Point> points = new List <Point>(); points.Add(new Point(coord.X - size, coord.Y - size)); points.Add(new Point(coord.X + size, coord.Y - size)); points.Add(new Point(coord.X + size, coord.Y + size)); points.Add(new Point(coord.X - size, coord.Y + size)); drawer.FillColor(color); drawer.DrawPolygon(points); }
public static void DrawGreenPolygon(FoxDraw foxDraw, int squareSide, int w) { var half = 150; //canvas.ActualHeight / 2; var x = half - squareSide / 2; var y = half + squareSide / 2; var points = new List<Point>(); points.Add(new Point(x, x)); points.Add(new Point(x, y)); points.Add(new Point(y, y)); points.Add(new Point(y, x)); byte b = Convert.ToByte(w + 100); byte c = Convert.ToByte(150-w); byte d = Convert.ToByte((150-w)/2); foxDraw.FillColor(Color.FromRgb(b, c, d)); foxDraw.DrawPolygon(points); }