Beispiel #1
0
        private void button10_Click(object sender, System.EventArgs e)
        {
            // initialize
            C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument();

            // create points
            PointF[] pts = new PointF[]
            {
                new PointF(100, 100), new PointF(120, 30),
                new PointF(200, 140), new PointF(230, 20),
            };

            // draw Bezier spline
            pdf.DrawBezier(new Pen(Color.Blue, 4), pts[0], pts[1], pts[2], pts[3]);

            // show points
            pdf.DrawLines(Pens.Gray, pts);
            foreach (PointF pt in pts)
            {
                pdf.DrawRectangle(Pens.Red, pt.X - 2, pt.Y - 2, 4, 4);
            }

            string fileName = tempdir + "bezier.pdf";

            pdf.Save(fileName);
            System.Diagnostics.Process.Start(fileName);
        }