예제 #1
0
        private void AddText(Point point, string text, Color color)
        {
            TextBlock textBlock = new TextBlock {
                Text = text, Foreground = new SolidColorBrush(color)
            };

            MyCanvas.Children.Add(textBlock);
            Canvas.SetLeft(textBlock, point.X);
            Canvas.SetTop(textBlock, point.Y);
        }
예제 #2
0
        private void AddPoint(Point point)
        {
            var dot = new Ellipse
            {
                Width  = 5,
                Height = 5,
                Stroke = Brushes.Red,
                Fill   = Brushes.Red
            };

            MyCanvas.Children.Add(dot);
            Canvas.SetTop(dot, point.Y);
            Canvas.SetLeft(dot, point.X);
        }