예제 #1
0
        public MainWindow()
        {
            // draw a box that has different colored lines on each edge.
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            foxDraw.StrokeColor(Colors.Green);
            var startPoint = new Point(150, 150);
            var endPoint   = new Point(450, 150);

            foxDraw.DrawLine(startPoint, endPoint);

            foxDraw.StrokeColor(Colors.Magenta);
            var startPoint2 = new Point(150, 450);
            var endPoint2   = new Point(450, 450);

            foxDraw.DrawLine(startPoint2, endPoint2);

            foxDraw.StrokeColor(Colors.Yellow);
            var startPoint3 = new Point(450, 150);
            var endPoint3   = new Point(450, 450);

            foxDraw.DrawLine(startPoint3, endPoint3);

            foxDraw.StrokeColor(Colors.Aquamarine);
            var startPoint4 = new Point(150, 150);
            var endPoint4   = new Point(150, 450);

            foxDraw.DrawLine(startPoint4, endPoint4);
        }
예제 #2
0
        // draw a box that has different colored lines on each edge.

        public static void DrawBox(FoxDraw foxDraw)
        {
            foxDraw.StrokeColor(Colors.Turquoise);
            foxDraw.DrawLine(10, 20, 100, 20);

            foxDraw.StrokeColor(Colors.Aqua);
            foxDraw.DrawLine(100, 20, 100, 40);

            foxDraw.StrokeColor(Colors.PowderBlue);
            foxDraw.DrawLine(100, 40, 10, 40);

            foxDraw.StrokeColor(Colors.AliceBlue);
            foxDraw.DrawLine(10, 40, 10, 20);
        }
예제 #3
0
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            // Draw a box that has different colored lines on each edge.
            foxDraw.StrokeColor(Colors.Pink);
            foxDraw.DrawLine(50, 100, 100, 100, 10);

            foxDraw.StrokeColor(Colors.Green);
            foxDraw.DrawLine(100, 100, 100, 200, 10);

            foxDraw.StrokeColor(Colors.Blue);
            foxDraw.DrawLine(100, 200, 50, 200, 10);

            foxDraw.StrokeColor(Colors.Yellow);
            foxDraw.DrawLine(50, 200, 50, 100, 10);
        }
예제 #4
0
        public MainWindow()
        {
            InitializeComponent();

            var foxDraw = new FoxDraw(canvas);

            double x1 = 10;
            double y1 = 80;
            double x2 = 120;
            double y2 = 100;

            foxDraw.StrokeColor(Colors.LavenderBlush);
            foxDraw.DrawLine(x1, y1, x2, y1);

            foxDraw.StrokeColor(Colors.DeepPink);
            foxDraw.DrawLine(x1, y2, x2, y2);

            foxDraw.StrokeColor(Colors.LightBlue);
            foxDraw.DrawLine(x1, y1, x1, y2);

            foxDraw.StrokeColor(Colors.Lime);
            foxDraw.DrawLine(x2, y1, x2, y2);
        }
예제 #5
0
 public static void DrawLine(FoxDraw draw, Color color, Point startPoint, Point endPoint)
 {
     draw.StrokeColor(color);
     draw.DrawLine(startPoint, endPoint);
 }