iTextSharp.text.pdf.PdfContentByte.Arc C# (CSharp) Метод

Arc() публичный метод

public Arc ( float x1, float y1, float x2, float y2, float startAng, float extent ) : void
x1 float
y1 float
x2 float
y2 float
startAng float
extent float
Результат void
        public void Arc(float x1, float y1, float x2, float y2, float startAng, float extent)
        {
            List<float[]> ar = BezierArc(x1, y1, x2, y2, startAng, extent);
            if (ar.Count == 0)
                return;
            float[] pt = ar[0];
            MoveTo(pt[0], pt[1]);
            for (int k = 0; k < ar.Count; ++k) {
                pt = ar[k];
                CurveTo(pt[2], pt[3], pt[4], pt[5], pt[6], pt[7]);
            }
        }

Usage Example

Пример #1
0
        private void DrawArc(PdfContentByte cb, IList<float> numbers)
        {
            EllipseArc ellipse = EllipseArc.CreateEllipseArc(numbers[7], numbers[8], numbers[5], numbers[6], numbers[0], numbers[1], numbers[4], numbers[3]);

            cb.SetColorFill(BaseColor.ORANGE);
            cb.Rectangle(numbers[7], numbers[8], 2, 2); //p1
            cb.Fill();
            cb.SetColorFill(BaseColor.GREEN);
            cb.Rectangle(numbers[5], numbers[6], 2, 2); //p2
            cb.Fill();

            cb.Arc(ellipse.Cx - numbers[0], ellipse.Cy - numbers[1], ellipse.Cx + numbers[0], ellipse.Cy + numbers[1],
                    ellipse.StartAng, ellipse.Extend);
        }
PdfContentByte