コード例 #1
0
        ////////////////////////////////////////////////////////////////////
        // Draw rectangle with rounded corners and filled with brick pattern
        ////////////////////////////////////////////////////////////////////
        private void DrawBrickPattern(
			PdfDocument Document,
			PdfContents Contents
			)
        {
            // Define brick tilling pattern resource
            // Arguments: PdfDocument class, Scale factor (0.25), Stroking color (lines between bricks), Nonstroking color (brick)
            // Return value: tilling pattern resource
            PdfTilingPattern BrickPattern = PdfTilingPattern.SetBrickPattern(Document, 0.25, Color.LightYellow, Color.SandyBrown);

            // save graphics state
            Contents.SaveGraphicsState();

            // set outline width 0.04"
            Contents.SetLineWidth(0.04);

            // set outline color to purple
            Contents.SetColorStroking(Color.Purple);

            // set fill pattern to brick
            Contents.SetPatternNonStroking(BrickPattern);

            // draw rounded rectangle filled with brick pattern
            Contents.DrawRoundedRectangle(1.13, 5.0, 1.4, 1.4, 0.2, PaintOp.CloseFillStroke);

            // restore graphics sate
            Contents.RestoreGraphicsState();
            return;
        }