當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfContentByte.ClosePath方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfContentByte.ClosePath方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfContentByte.ClosePath方法的具體用法?C# PdfContentByte.ClosePath怎麽用?C# PdfContentByte.ClosePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfContentByte的用法示例。


在下文中一共展示了PdfContentByte.ClosePath方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawTimeTable

        // ---------------------------------------------------------------------------    
        /**
         * Draws the time table for a day at the film festival.
         * @param directcontent a canvas to which the time table has to be drawn.
         */
        protected void DrawTimeTable(PdfContentByte directcontent)
        {
            directcontent.SaveState();
            directcontent.SetLineWidth(1.2f);
            float llx, lly, urx, ury;

            llx = OFFSET_LEFT;
            lly = OFFSET_BOTTOM;
            urx = OFFSET_LEFT + WIDTH;
            ury = OFFSET_BOTTOM + HEIGHT;
            directcontent.MoveTo(llx, lly);
            directcontent.LineTo(urx, lly);
            directcontent.LineTo(urx, ury);
            directcontent.LineTo(llx, ury);
            directcontent.ClosePath();
            directcontent.Stroke();

            llx = OFFSET_LOCATION;
            lly = OFFSET_BOTTOM;
            urx = OFFSET_LOCATION + WIDTH_LOCATION;
            ury = OFFSET_BOTTOM + HEIGHT;
            directcontent.MoveTo(llx, lly);
            directcontent.LineTo(urx, lly);
            directcontent.LineTo(urx, ury);
            directcontent.LineTo(llx, ury);
            directcontent.ClosePathStroke();

            directcontent.SetLineWidth(1);
            directcontent.MoveTo(
              OFFSET_LOCATION + WIDTH_LOCATION / 2, OFFSET_BOTTOM
            );
            directcontent.LineTo(
              OFFSET_LOCATION + WIDTH_LOCATION / 2, OFFSET_BOTTOM + HEIGHT
            );
            float y;
            for (int i = 1; i < LOCATIONS; i++)
            {
                y = OFFSET_BOTTOM + (i * HEIGHT_LOCATION);
                if (i == 2 || i == 6)
                {
                    directcontent.MoveTo(OFFSET_LOCATION, y);
                    directcontent.LineTo(OFFSET_LOCATION + WIDTH_LOCATION, y);
                }
                else
                {
                    directcontent.MoveTo(OFFSET_LOCATION + WIDTH_LOCATION / 2, y);
                    directcontent.LineTo(OFFSET_LOCATION + WIDTH_LOCATION, y);
                }
                directcontent.MoveTo(OFFSET_LEFT, y);
                directcontent.LineTo(OFFSET_LEFT + WIDTH, y);
            }
            directcontent.Stroke();
            directcontent.RestoreState();
        }
開發者ID:kuujinbo,項目名稱:iTextInAction2Ed,代碼行數:59,代碼來源:MovieTimeTable.cs

示例2: CreateStar

 // ---------------------------------------------------------------------------
 /**
  * Creates a path for a five pointed star.
  * This method doesn't fill or stroke the star!
  * @param canvas the canvas for which the star is constructed
  * @param x      the X coordinate of the center of the star
  * @param y      the Y coordinate of the center of the star
  */
 public static void CreateStar(PdfContentByte canvas, float x, float y)
 {
     canvas.MoveTo(x + 10, y);
       canvas.LineTo(x + 80, y + 60);
       canvas.LineTo(x, y + 60);
       canvas.LineTo(x + 70, y);
       canvas.LineTo(x + 40, y + 90);
       canvas.ClosePath();
 }
開發者ID:kuujinbo,項目名稱:iTextInAction2Ed,代碼行數:17,代碼來源:PathConstructionAndPainting.cs

示例3: AddColoredRectangle

        private void AddColoredRectangle(PdfContentByte canvas, PdfCleanUpLocation cleanUpLocation) {
            Rectangle cleanUpRegion = cleanUpLocation.Region;

            canvas.SaveState();
            canvas.SetColorFill(cleanUpLocation.CleanUpColor);
            canvas.MoveTo(cleanUpRegion.Left, cleanUpRegion.Bottom);
            canvas.LineTo(cleanUpRegion.Right, cleanUpRegion.Bottom);
            canvas.LineTo(cleanUpRegion.Right, cleanUpRegion.Top);
            canvas.LineTo(cleanUpRegion.Left, cleanUpRegion.Top);
            canvas.ClosePath();
            canvas.Fill();
            canvas.RestoreState();
        }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:13,代碼來源:PdfCleanUpProcessor.cs

示例4: DrawElement

        void DrawElement(PdfContentByte cb)
        {
            try
            {
                IList<PathItem> translatedItems = Translate(path.PathItems);

                //loop over the items in the path
                foreach (PathItem item in translatedItems)
                {
                    IList<float> numbers = item.Coordinates;

                    if (item.IsMoveTo())
                    {
                        cb.MoveTo(numbers[0], numbers[1]);
                    }
                    else if (item.IsLineTo())
                    {
                        cb.LineTo(numbers[0], numbers[1]);
                    }
                    else if (item.IsCubicBezier())
                    {
                        cb.CurveTo(numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5]);
                    }
                    else if (item.IsQuadraticBezier())
                    {
                        cb.CurveTo(numbers[0], numbers[1], numbers[2], numbers[3]);
                    }
                    else if (item.IsArcTo())
                    {
                        DrawArc(cb, numbers);
                    }
                    else if (item.IsClosePath())
                    {
                        cb.ClosePath();
                    }
                    else
                    {
                        //System.out.Println(item);
                    }
                }
            } catch {
                //TODO
            }
        }
開發者ID:,項目名稱:,代碼行數:44,代碼來源:

示例5: Draw

        protected override void Draw(PdfContentByte cb)
        {
            //TODO check the line width with this rectangles SVG takes 5 pixel out and 5 pixels in when asking line-width=10
            //TODO check the values for rx and ry what if they get to big

            if (rx == 0 || ry == 0)
            {
                cb.Rectangle(x, y, width, height);
            }
            else
            { //corners
                /*
			
                if(rx > x / 2){
                    rx = x/2;
                }
                if(ry > y / 2){
                    ry = y/2;
                }*/

                cb.MoveTo(x + rx, y);
                cb.LineTo(x + width - rx, y);
                Arc(x + width - 2 * rx, y, x + width, y + 2 * ry, -90, 90, cb);
                cb.LineTo(x + width, y + height - ry);
                Arc(x + width, y + height - 2 * ry, x + width - 2 * rx, y + height, 0, 90, cb);
                cb.LineTo(x + rx, y + height);
                Arc(x + 2 * rx, y + height, x, y + height - 2 * ry, 90, 90, cb);
                cb.LineTo(x, y + ry);
                Arc(x, y + 2 * ry, x + 2 * rx, y, 180, 90, cb);
                cb.ClosePath();
            }

        }
開發者ID:,項目名稱:,代碼行數:33,代碼來源:


注:本文中的iTextSharp.text.pdf.PdfContentByte.ClosePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。