public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { rect = rect.Translate(CurrentScore.DefaultPageSettings); PathGeometry pathGeom = new PathGeometry(); PathFigure pf = new PathFigure(); pf.StartPoint = new Point(rect.X, rect.Y); ArcSegment arcSeg = new ArcSegment(); arcSeg.Point = new Point(rect.X + rect.Width, rect.Y); arcSeg.RotationAngle = startAngle; arcSeg.Size = new Size(rect.Width, rect.Height); arcSeg.SweepDirection = sweepAngle < 180 ? SweepDirection.Counterclockwise : SweepDirection.Clockwise; arcSeg.IsLargeArc = sweepAngle > 180; pf.Segments.Add(arcSeg); pathGeom.Figures.Add(pf); Path path = new Path(); path.Stroke = new SolidColorBrush(ConvertColor(pen.Color)); path.StrokeThickness = pen.Thickness; path.Data = pathGeom; path.Visibility = BoolToVisibility(owner.IsVisible); Windows.UI.Xaml.Controls.Canvas.SetZIndex(path, (int)pen.ZIndex); Canvas.Children.Add(path); OwnershipDictionary.Add(path, owner); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { if (!EnsureProperPage(owner)) { return; } if (Settings.RenderingMode != ScoreRenderingModes.Panorama) { rect = rect.Translate(CurrentScore.DefaultPageSettings); } var arc = new Arc(); arc.TranslationX = rect.X; arc.TranslationY = rect.Y; arc.RX = rect.Width; arc.RY = rect.Height; arc.Thickness = pen.Thickness; arc.StartAngle = startAngle; arc.SweepAngle = sweepAngle; arc.Color = pen.Color; Canvas.Children.Add(arc); OwnershipDictionary.Add(arc, owner); }
public void AddRectangle(Primitives.Rectangle rectangle, bool fill = false) { _sink.BeginFigure(new RawVector2(rectangle.Left, rectangle.Top), fill ? FigureBegin.Filled : FigureBegin.Hollow); _sink.AddLine(new RawVector2(rectangle.Right, rectangle.Top)); _sink.AddLine(new RawVector2(rectangle.Right, rectangle.Bottom)); _sink.AddLine(new RawVector2(rectangle.Left, rectangle.Bottom)); _sink.EndFigure(FigureEnd.Closed); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { renderingQueue.Enqueue(() => base.DrawArc(rect, startAngle, sweepAngle, pen, owner)); if (renderingQueue.Count > BufferSize) { FlushBuffer(); } }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, Model.MusicalSymbol owner) { Canvas.AppendLine("context.beginPath();"); Canvas.AppendLine(string.Format("context.arc({0},{1},{2},{3},{4});", rect.X.ToStringInvariant(), rect.Y.ToStringInvariant(), rect.Height.ToStringInvariant(), UsefulMath.GradToRadians(startAngle).ToStringInvariant(), UsefulMath.GradToRadians(sweepAngle).ToStringInvariant())); Canvas.AppendLine("context.stroke();"); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { PathGeometry pathGeom = new PathGeometry(); PathFigure pf = new PathFigure(); pf.StartPoint = new Point(rect.X, rect.Y); ArcSegment arcSeg = new ArcSegment(new Point(rect.X, rect.Y), new Size(rect.Width, rect.Height), startAngle, false, SweepDirection.Clockwise, true); pf.Segments.Add(arcSeg); pathGeom.Figures.Add(pf); Canvas.DrawGeometry(null, ConvertPen(pen), pathGeom); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { if (!EnsureProperPage(owner)) { return; } if (Settings.RenderingMode != ScoreRenderingModes.Panorama) { rect = rect.Translate(CurrentScore.DefaultPageSettings); } Canvas.DrawArc(ConvertPen(pen), new RectangleF((float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height), (float)startAngle, (float)sweepAngle); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, MusicalSymbol owner) { if (!EnsureProperPage(owner)) { return; } if (Settings.RenderingMode != ScoreRenderingModes.Panorama) { rect = rect.Translate(CurrentScore.DefaultPageSettings); } if (rect.Width < 0 || rect.Height < 0) { return; //TODO: Sprawdzić czemu tak się dzieje, poprawić } PathGeometry pathGeom = new PathGeometry(); PathFigure pf = new PathFigure(); pf.StartPoint = new Point(rect.X, rect.Y); ArcSegment arcSeg = new ArcSegment(); arcSeg.Point = new Point(rect.X + rect.Width, rect.Y); arcSeg.RotationAngle = startAngle; arcSeg.Size = new Size(rect.Width, rect.Height); arcSeg.SweepDirection = sweepAngle < 180 ? SweepDirection.Counterclockwise : SweepDirection.Clockwise; arcSeg.IsLargeArc = sweepAngle > 180; pf.Segments.Add(arcSeg); pathGeom.Figures.Add(pf); Path path = new Path(); path.Stroke = new SolidColorBrush(ConvertColor(pen.Color)); path.StrokeThickness = pen.Thickness; path.Data = pathGeom; path.Visibility = BoolToVisibility(owner.IsVisible); Canvas.Children.Add(path); OwnershipDictionary.Add(path, owner); }
public override void DrawArc(Primitives.Rectangle rect, double startAngle, double sweepAngle, Primitives.Pen pen, Model.MusicalSymbol owner) { }