Ejemplo n.º 1
0
 public static PDFPen Create(PDFBrush brush, PDFUnit width)
 {
     if (brush.FillStyle == FillType.Solid)
     {
         PDFSolidBrush solid = (PDFSolidBrush)brush;
         PDFPen        pen   = Create(solid.Color, width);
         pen.Opacity = solid.Opacity;
         return(pen);
     }
     else
     {
         return(new PDFNoPen());
     }
 }
Ejemplo n.º 2
0
        public void FillPath(PDFBrush brush, PDFPoint location, PDFGraphicsPath path)
        {
            if (null == path)
            {
                throw new ArgumentNullException("path");
            }

            if (null == brush)
            {
                throw new ArgumentNullException("brush");
            }

            this.SaveGraphicsState();
            this.OutputPath(brush, null, location, path);
            this.RestoreGraphicsState();
        }
Ejemplo n.º 3
0
        public void FillElipse(PDFBrush brush, PDFUnit x, PDFUnit y, PDFUnit width, PDFUnit height)
        {
            if (brush == null)
            {
                throw new ArgumentNullException("brush");
            }

            PDFRect bounds = new PDFRect(x, y, width, height);

            this.SaveGraphicsState();
            brush.SetUpGraphics(this, bounds);

            OutputElipsePoints(x, y, width, height);
            this.RenderFillPathOp();

            brush.ReleaseGraphics(this, bounds);

            this.RestoreGraphicsState();
        }
Ejemplo n.º 4
0
        private void OutputPath(PDFBrush brush, PDFPen pen, PDFPoint location, PDFGraphicsPath path)
        {
            PDFRect bounds = new PDFRect(path.Bounds.X + location.X, path.Bounds.Y + location.Y, path.Bounds.Width, path.Bounds.Height);

            if (null != brush)
            {
                brush.SetUpGraphics(this, bounds);
            }
            if (null != pen)
            {
                pen.SetUpGraphics(this, bounds);
            }

            PDFPoint cursor = PDFPoint.Empty;

            foreach (Path p in path.SubPaths)
            {
                RenderPathData(location, p, ref cursor);
            }

            if (null != brush && null != pen)
            {
                this.RenderFillAndStrokePathOp(path.Mode == GraphicFillMode.EvenOdd);
            }
            else if (null != brush)
            {
                this.RenderFillPathOp(path.Mode == GraphicFillMode.EvenOdd);
            }
            else if (null != pen)
            {
                this.RenderStrokePathOp();
            }


            if (null != brush)
            {
                brush.ReleaseGraphics(this, bounds);
            }
            if (null != pen)
            {
                pen.ReleaseGraphics(this, bounds);
            }
        }
Ejemplo n.º 5
0
        public void FillRoundRectangle(PDFBrush brush, PDFUnit x, PDFUnit y, PDFUnit width, PDFUnit height, Sides sides, PDFUnit cornerRadius)
        {
            if (brush == null)
            {
                throw new ArgumentNullException("brush");
            }

            if (null != brush.UnderBrush)
            {
                this.FillRoundRectangle(brush.UnderBrush, x, y, width, height, sides, cornerRadius);
            }

            PDFRect bounds = new PDFRect(x, y, width, height);

            this.SaveGraphicsState();
            brush.SetUpGraphics(this, bounds);
            this.DoOutputRoundRectangleWithSidesFill(x, y, width, height, cornerRadius, sides);
            this.RenderFillPathOp();
            brush.ReleaseGraphics(this, bounds);
            this.RestoreGraphicsState();
        }
Ejemplo n.º 6
0
        public void FillRoundRectangle(PDFBrush brush, PDFRect rect, PDFUnit cornerRadius)
        {
            if (brush == null)
            {
                throw new ArgumentNullException("brush");
            }

            if (null != brush.UnderBrush)
            {
                this.FillRoundRectangle(brush.UnderBrush, rect, cornerRadius);
            }

            this.SaveGraphicsState();
            //PDFRect bounds = new PDFRect(x, y, width, height);

            brush.SetUpGraphics(this, rect);
            this.DoOutputRoundRectangle(rect.X, rect.Y, rect.Width, rect.Height, cornerRadius);
            this.RenderFillPathOp();
            brush.ReleaseGraphics(this, rect);

            this.RestoreGraphicsState();
        }
Ejemplo n.º 7
0
        public void FillRectangle(PDFBrush brush, PDFUnit x, PDFUnit y, PDFUnit width, PDFUnit height)
        {
            if (brush == null)
            {
                throw new ArgumentNullException("brush");
            }

            if (null != brush.UnderBrush)
            {
                FillRectangle(brush.UnderBrush, x, y, width, height);
            }

            this.SaveGraphicsState();
            PDFRect bounds = new PDFRect(x, y, width, height);

            brush.SetUpGraphics(this, bounds);

            this.RenderRectangle(x, y, width, height);
            this.RenderFillPathOp();

            brush.ReleaseGraphics(this, bounds);

            this.RestoreGraphicsState();
        }
Ejemplo n.º 8
0
 public void FillRectangle(PDFBrush brush, PDFRect rect)
 {
     this.FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);
 }
Ejemplo n.º 9
0
 public void FillRoundRectangle(PDFBrush brush, PDFPoint pos, PDFSize size, Sides sides, PDFUnit cornerRadius)
 {
     this.FillRoundRectangle(brush, pos.X, pos.Y, size.Width, size.Height, sides, cornerRadius);
 }
Ejemplo n.º 10
0
 public void FillRoundRectangle(PDFBrush brush, PDFRect rect, Sides sides, PDFUnit cornerRadius)
 {
     this.FillRoundRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, sides, cornerRadius);
 }
Ejemplo n.º 11
0
        public void FillRoundRectangle(PDFBrush brush, PDFPoint pos, PDFSize size, PDFUnit cornerRadius)
        {
            PDFRect r = new PDFRect(pos, size);

            this.FillRoundRectangle(brush, r, cornerRadius);
        }
Ejemplo n.º 12
0
        public void FillRoundRectangle(PDFBrush brush, PDFUnit x, PDFUnit y, PDFUnit width, PDFUnit height, PDFUnit cornerRadius)
        {
            PDFRect rect = new PDFRect(x, y, width, height);

            this.FillRoundRectangle(brush, rect, cornerRadius);
        }
Ejemplo n.º 13
0
 public void FillRectangle(PDFBrush brush, PDFPoint location, PDFSize size)
 {
     this.FillRectangle(brush, location.X, location.Y, size.Width, size.Height);
 }
Ejemplo n.º 14
0
 public void FillQuadrants(PDFBrush brush, PDFRect rect, Quadrants sides)
 {
     this.FillQuadrants(brush, rect.Location, rect.Size, sides);
 }
Ejemplo n.º 15
0
 public void FillQuadrants(PDFBrush brush, PDFPoint pos, PDFSize size, Quadrants sides)
 {
     this.FillQuadrants(brush, pos.X, pos.Y, size.Width, size.Height, sides);
 }
Ejemplo n.º 16
0
 public void FillElipse(PDFBrush brush, PDFPoint pos, PDFSize size)
 {
     this.FillElipse(brush, pos.X, pos.Y, size.Width, size.Height);
 }
Ejemplo n.º 17
0
 public void FillElipse(PDFBrush brush, PDFRect rect)
 {
     this.FillElipse(brush, rect.Location, rect.Size);
 }