Ejemplo n.º 1
0
        public void                                Draw(PdfStyleLine lineStyle, PdfStyleFill fillStyle, PdfPoint begin, PdfSize[] sizes, bool closePath)
        {
            if (_textMode)
            {
                opEndText();
            }

            if (lineStyle != null)
            {
                SetLineStyle(lineStyle);
            }

            if (fillStyle != null)
            {
                SetFillStyle(fillStyle);
            }

            opMoveTo(begin);

            if (sizes != null)
            {
                PdfPoint Pos = begin;

                for (int i = 0; i < sizes.Length; ++i)
                {
                    Pos += sizes[i];
                    opLineTo(Pos);
                }
            }

            if (closePath)
            {
                if (lineStyle != null & fillStyle != null)
                {
                    opCloseFillStroke();
                }
                else
                if (lineStyle != null)
                {
                    opCloseStroke();
                }
                else
                if (fillStyle != null)
                {
                    opClosePath();
                    opFill();
                }
            }
            else
            {
                if (fillStyle != null)
                {
                    throw new PdfException("Can't fill a non closed path.");
                }

                opStroke();
            }
        }
Ejemplo n.º 2
0
 public void                                opLineTo(PdfPoint point)
 {
     WriteNumber(point.x.pnts, 2, true);
     WriteNumber(point.y.pnts, 2, true);
     WriteStr(bs_l);
 }
Ejemplo n.º 3
0
        public void                                DrawRectangle(PdfStyleLine lineStyle, PdfStyleFill fillStyle, PdfPoint begin, PdfSize size)
        {
            if (_textMode)
            {
                opEndText();
            }

            if (lineStyle != null)
            {
                SetLineStyle(lineStyle);
            }

            if (fillStyle != null)
            {
                SetFillStyle(fillStyle);
            }

            opRectangle(begin, size);

            if (lineStyle != null & fillStyle != null)
            {
                opFillStroke();
            }
            else
            if (lineStyle != null)
            {
                opStroke();
            }
            else
            if (fillStyle != null)
            {
                opFill();
            }
        }