Exemple #1
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();
        }
Exemple #2
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);
            }
        }
Exemple #3
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();
        }
Exemple #4
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();
        }
Exemple #5
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();
        }