コード例 #1
0
// ---------------------------------------------------------------------------

        /**
         * Draws a row of stars and circles.
         * @param canvas the canvas to which the shapes have to be drawn
         * @param x      X coordinate to position the row
         * @param y      Y coordinate to position the row
         * @param radius the radius of the circles
         * @param gutter the space between the shapes
         */
        public static void CreateStarsAndCircles(PdfContentByte canvas,
                                                 float x, float y, float radius, float gutter)
        {
            canvas.SaveState();
            canvas.SetColorStroke(new GrayColor(0.2f));
            canvas.SetColorFill(new GrayColor(0.9f));
            CreateStar(canvas, x, y);
            CreateCircle(canvas, x + radius, y - 70, radius, true);
            CreateCircle(canvas, x + radius, y - 70, radius / 2, true);
            canvas.Fill();
            x += 2 * radius + gutter;
            CreateStar(canvas, x, y);
            CreateCircle(canvas, x + radius, y - 70, radius, true);
            CreateCircle(canvas, x + radius, y - 70, radius / 2, true);
            canvas.EoFill();
            x += 2 * radius + gutter;
            CreateStar(canvas, x, y);
            canvas.NewPath();
            CreateCircle(canvas, x + radius, y - 70, radius, true);
            CreateCircle(canvas, x + radius, y - 70, radius / 2, true);
            x += 2 * radius + gutter;
            CreateStar(canvas, x, y);
            CreateCircle(canvas, x + radius, y - 70, radius, true);
            CreateCircle(canvas, x + radius, y - 70, radius / 2, false);
            canvas.FillStroke();
            x += 2 * radius + gutter;
            CreateStar(canvas, x, y);
            CreateCircle(canvas, x + radius, y - 70, radius, true);
            CreateCircle(canvas, x + radius, y - 70, radius / 2, true);
            canvas.EoFillStroke();
            canvas.RestoreState();
        }