public UIElement Draw(Canvas element, Tool tool, Point startingPoint, Point currentPoint) { Line line = new Line(); line.Fill = new SolidColorBrush(tool.GetNativeColorObject()); line.Stroke = new SolidColorBrush(tool.GetNativeColorObject()); line.X1 = startingPoint.X; line.X2 = currentPoint.X; line.Y1 = startingPoint.Y; line.Y2 = currentPoint.Y; element.Children.Add(line); return line; }
public UIElement Draw(Canvas canvas, Tool tool, Point startingPoint, Point currentPoint) { FirstUsageAction(startingPoint); Line pencilDrawing = new Line(); pencilDrawing.Fill = new SolidColorBrush(tool.GetNativeColorObject()); pencilDrawing.Stroke = new SolidColorBrush(tool.GetNativeColorObject()); pencilDrawing.X1 = _previousPoint.X; pencilDrawing.X2 = currentPoint.X; pencilDrawing.Y1 = _previousPoint.Y; pencilDrawing.Y2 = currentPoint.Y; canvas.Children.Add(pencilDrawing); _previousPoint = currentPoint; return pencilDrawing; }
public UIElement Draw(Canvas element, Tool tool, Point startingPoint, Point currentPoint) { DrawingShapeSetuper shapeSetuper = new DrawingShapeSetuper(); Ellipse ellipse = new Ellipse(); ellipse.Fill = new SolidColorBrush(tool.GetNativeColorObject()); ellipse.Width = shapeSetuper.GetWidthOfShape(startingPoint, currentPoint); ellipse.Height = shapeSetuper.GetHeightOfShape(startingPoint, currentPoint); shapeSetuper.SetUpShape(ellipse, startingPoint, currentPoint); element.Children.Add(ellipse); return ellipse; }