SvgCubicCurveSegment.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Drawing;
  5. #pragma warning disable
  6. namespace Svg.Pathing
  7. {
  8. public sealed class SvgCubicCurveSegment : SvgPathSegment
  9. {
  10. private PointF _firstControlPoint;
  11. private PointF _secondControlPoint;
  12. public PointF FirstControlPoint
  13. {
  14. get { return this._firstControlPoint; }
  15. set { this._firstControlPoint = value; }
  16. }
  17. public PointF SecondControlPoint
  18. {
  19. get { return this._secondControlPoint; }
  20. set { this._secondControlPoint = value; }
  21. }
  22. public SvgCubicCurveSegment(PointF start, PointF firstControlPoint, PointF secondControlPoint, PointF end)
  23. {
  24. this.Start = start;
  25. this.End = end;
  26. this._firstControlPoint = firstControlPoint;
  27. this._secondControlPoint = secondControlPoint;
  28. }
  29. public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
  30. {
  31. graphicsPath.AddBezier(this.Start, this.FirstControlPoint, this.SecondControlPoint, this.End);
  32. }
  33. public override string ToString()
  34. {
  35. return "C" + this.FirstControlPoint.ToSvgString() + " " + this.SecondControlPoint.ToSvgString() + " " + this.End.ToSvgString();
  36. }
  37. }
  38. }
  39. #pragma warning restore