PdfSharp.Xps.Rendering.PdfContentWriter.AddCapToPath C# (CSharp) Méthode

AddCapToPath() public méthode

public AddCapToPath ( PdfSharp.Xps.XpsModel.Path path, PdfSharp.Xps.XpsModel.PathFigure figure, double length, double lineWidthHalf, LineCap lineCap, PdfSharp.Drawing.XMatrix matrix ) : void
path PdfSharp.Xps.XpsModel.Path
figure PdfSharp.Xps.XpsModel.PathFigure
length double
lineWidthHalf double
lineCap LineCap
matrix PdfSharp.Drawing.XMatrix
Résultat void
    void AddCapToPath(Path path, PathFigure figure, double length, double lineWidthHalf, LineCap lineCap, XMatrix matrix)
    {
      // sketch:
      // 1. create Transform that make a horizontal line with start in 0,0
      // 2. create a Polygon with the shape of the line including its caps
      // 3. render the shape with the brush of the pen
      //PolyLineSegment seg;
      switch (lineCap)
      {
        case LineCap.Flat:
          matrix.Transform(new XPoint(length + lineWidthHalf, -lineWidthHalf));
          break;

        case LineCap.Square:
          matrix.Transform(new XPoint(length + lineWidthHalf, -lineWidthHalf));
          break;

        case LineCap.Round:
          break;

        case LineCap.Triangle:
          break;
      }
    }