示例#1
0
		//	http://www.mikesdotnetting.com/Article/88/iTextSharp-Drawing-shapes-and-Graphics
		
		public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
		                                BaseLine line,
		                                IBaseStyleDecorator style,
		                                iTextSharp.text.Rectangle rectangle)
		{
		
			if (contentByte == null) {
				throw new ArgumentNullException("contentByte");
			}
		
			if (style == null) {
				throw new ArgumentNullException("style");
			}
			if (rectangle == null) {
				throw new ArgumentNullException("rectangle");
			}
		
			if (line == null) {
				BaseShape.FillBackGround(contentByte,style,rectangle);
			} 
			else
			{
				BaseShape.SetupShape(contentByte,style);
				contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
				contentByte.RoundRectangle(rectangle.Left, rectangle.Bottom, rectangle.Width, rectangle.Height, CornerRadius);
				BaseShape.FinishShape(contentByte);
			}
		}
示例#2
0
		public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
		                                BaseLine line,
		                                IBaseStyleDecorator style,
		                                iTextSharp.text.Rectangle rectangle)
		{
			if (contentByte == null) {
				throw new ArgumentNullException("contentByte");
			}
			if (style == null) {
				throw new ArgumentNullException("style");
			}
			if (rectangle == null) {
				throw new ArgumentNullException("rectangle");
			}
			
			if ((line == null)||(line.Thickness < 1)) {
				BaseShape.FillBackGround(contentByte,style,rectangle);
			}
			else if ((style.BackColor == GlobalValues.DefaultBackColor)) {
				BaseShape.SetupShape(contentByte,style);
				contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
				contentByte.MoveTo(rectangle.Left ,rectangle.Top );
				contentByte.LineTo(rectangle.Left, rectangle.Top - rectangle.Height);
				contentByte.LineTo(rectangle.Left + rectangle.Width, rectangle.Top - rectangle.Height);
				contentByte.LineTo(rectangle.Left   + rectangle.Width, rectangle.Top);
				contentByte.LineTo(rectangle.Left, rectangle.Top);
				BaseShape.FinishShape(contentByte);
			} else {
				BaseShape.FillBackGround(contentByte,style,rectangle);
			}
		}
示例#3
0
 public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
                                 BaseLine line,
                                 IBaseStyleDecorator style,
                                 iTextSharp.text.Rectangle rectangle)
 {
     throw new NotImplementedException();
 }
示例#4
0
 public void DrawShape(PdfContentByte cb,
                       BaseLine line,
                       IBaseStyleDecorator style,
                       iTextSharp.text.Rectangle r)
 {
     this.CreatePath(cb, line, style, r);
 }
示例#5
0
 public void DrawShape(PdfContentByte cb,
                       BaseLine line,
                       IBaseStyleDecorator style,
                       Point from, Point to)
 {
     this.CreatePath(cb, line, style, from, to);
 }
示例#6
0
        public override void Render(ReportPageEventArgs rpea)
        {
            if (rpea == null)
            {
                throw new ArgumentNullException("rpea");
            }
            base.Render(rpea);
            Rectangle rectangle = base.DisplayRectangle;

            StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics, this.BaseStyleDecorator);

            BaseLine line = new BaseLine(base.ForeColor, base.DashStyle, base.Thickness, LineCap.Round, LineCap.Round, DashCap.Round);

            using (Pen pen = line.CreatePen(line.Thickness)){
                if (pen != null)
                {
                    shape.CornerRadius = this.CornerRadius;

                    GraphicsPath gfxPath = shape.CreatePath(rectangle);

                    rpea.PrintPageEventArgs.Graphics.FillPath(new SolidBrush(BackColor), gfxPath);;
                    rpea.PrintPageEventArgs.Graphics.DrawPath(pen, gfxPath);
                }
            }
        }
示例#7
0
		public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
		                                BaseLine line,
		                                IBaseStyleDecorator style,
		                                Point from,Point to)
		{
			throw new NotImplementedException();
		}
示例#8
0
        //	http://www.mikesdotnetting.com/Article/88/iTextSharp-Drawing-shapes-and-Graphics

        public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
                                        BaseLine line,
                                        IBaseStyleDecorator style,
                                        iTextSharp.text.Rectangle rectangle)
        {
            if (contentByte == null)
            {
                throw new ArgumentNullException("contentByte");
            }

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

            if (line == null)
            {
                BaseShape.FillBackGround(contentByte, style, rectangle);
            }
            else
            {
                BaseShape.SetupShape(contentByte, style);
                contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
                contentByte.RoundRectangle(rectangle.Left, rectangle.Bottom, rectangle.Width, rectangle.Height, CornerRadius);
                BaseShape.FinishShape(contentByte);
            }
        }
示例#9
0
        public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
                                        BaseLine line,
                                        IBaseStyleDecorator style,
                                        iTextSharp.text.Rectangle rectangle)
        {
            if (contentByte == null)
            {
                throw new ArgumentNullException("contentByte");
            }
            if (rectangle == null)
            {
                throw new ArgumentNullException("rectangle");
            }

            if ((line == null) || (line.Thickness < 1))
            {
                BaseShape.FillBackGround(contentByte, style, rectangle);
            }
            else if ((style.BackColor == GlobalValues.DefaultBackColor))
            {
                BaseShape.SetupShape(contentByte, style);
                contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
                contentByte.Ellipse(rectangle.Left,
                                    rectangle.Top,
                                    rectangle.Left + rectangle.Width,
                                    rectangle.Top - rectangle.Height);
                BaseShape.FinishShape(contentByte);
            }
            else
            {
                BaseShape.FillBackGround(contentByte, style, rectangle);
            }
        }
示例#10
0
		public override void Draw(Graphics graphics)
		{
			if (graphics == null) {
				throw new ArgumentNullException("graphics");
			}
			
			Rectangle rect = new Rectangle(this.ClientRectangle.Left,this.ClientRectangle.Top,
			                               this.ClientRectangle.Right -1,
			                               this.ClientRectangle.Bottom -1);
//			backgroundShape.FillShape(graphics,
//			                new SolidFillPattern(this.BackColor),
//			                rect);
			
			Border b = new Border(new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
//			DrawFrame(graphics,b);
			BaseLine line = new BaseLine(base.ForeColor,DashStyle,Thickness,LineCap.Round,LineCap.Round,DashCap.Round);
			using (Pen pen = line.CreatePen(line.Thickness)){
				shape.CornerRadius = this.CornerRadius;
				GraphicsPath path1 = shape.CreatePath(rect);
				graphics.DrawPath(pen, path1);
				
			}
			
//			shape.DrawShape (graphics,
//			                 this.Baseline(),
//			                 rect);
			
		}
示例#11
0
		public Border(BaseLine baseLine)
		{
			this.baseline = baseLine;
			this.left = baseLine;
			this.top = baseLine;
			this.right = baseLine;
			this.bottom = baseLine;
		}
示例#12
0
 public Border(BaseLine baseLine)
 {
     this.baseline = baseLine;
     this.left     = baseLine;
     this.top      = baseLine;
     this.right    = baseLine;
     this.bottom   = baseLine;
 }
示例#13
0
		public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
		                                BaseLine line,
		                                IBaseStyleDecorator style,
		                                Point from,Point to)
		{
			if (contentByte == null) {
				throw new ArgumentNullException("contentByte");
			}

			BaseShape.SetupShape(contentByte,style);
			contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
			contentByte.MoveTo(from.X,from.Y );
			contentByte.LineTo(to.X,to.Y);
			BaseShape.FinishShape(contentByte);
		}
示例#14
0
		// Draw a Line
		public void DrawShape(Graphics graphics, BaseLine line, Point from,Point to)
		{
			if (graphics == null) {
				throw new ArgumentNullException("graphics");
			}
			if (line == null) {
				throw new ArgumentNullException("line");
			}
			using (Pen pen = line.CreatePen(line.Thickness)){
				if (pen != null){
					GraphicsPath path1 = this.CreatePath(from,to);
					graphics.DrawPath(pen, path1);
				}
			}
		}
示例#15
0
        public override void CreatePath(iTextSharp.text.pdf.PdfContentByte contentByte,
                                        BaseLine line,
                                        IBaseStyleDecorator style,
                                        Point from, Point to)
        {
            if (contentByte == null)
            {
                throw new ArgumentNullException("contentByte");
            }

            BaseShape.SetupShape(contentByte, style);
            contentByte.SetLineWidth(UnitConverter.FromPixel(line.Thickness).Point);
            contentByte.MoveTo(from.X, from.Y);
            contentByte.LineTo(to.X, to.Y);
            BaseShape.FinishShape(contentByte);
        }
示例#16
0
 // Draw a Line
 public void DrawShape(Graphics graphics, BaseLine line, Point from, Point to)
 {
     if (graphics == null)
     {
         throw new ArgumentNullException("graphics");
     }
     if (line == null)
     {
         throw new ArgumentNullException("line");
     }
     using (Pen pen = line.CreatePen(line.Thickness)){
         if (pen != null)
         {
             GraphicsPath path1 = this.CreatePath(from, to);
             graphics.DrawPath(pen, path1);
         }
     }
 }
示例#17
0
        public virtual void DrawShape(Graphics graphics, BaseLine line, Rectangle rectangle)
        {
            if (graphics == null)
            {
                throw new ArgumentNullException("graphics");
            }
            if (line == null)
            {
                throw new ArgumentNullException("line");
            }

            using (Pen pen = line.CreatePen(line.Thickness)){
                if (pen != null)
                {
                    GraphicsPath path1 = this.CreatePath(rectangle);
                    graphics.DrawPath(pen, path1);
                }
            }
        }
示例#18
0
		public override void Render(ReportPageEventArgs rpea) {
			if (rpea == null) {
				throw new ArgumentNullException("rpea");
			}
			base.Render(rpea);
			Rectangle rectangle = base.DisplayRectangle;
			StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
			
			BaseLine line = new BaseLine(base.ForeColor,base.DashStyle,base.Thickness,LineCap.Round,LineCap.Round,DashCap.Round);
			
			using (Pen pen = line.CreatePen(line.Thickness)){
				if (pen != null)
				{
					shape.CornerRadius = this.CornerRadius;

					GraphicsPath gfxPath = shape.CreatePath(rectangle);
					
					rpea.PrintPageEventArgs.Graphics.FillPath(new SolidBrush(BackColor), gfxPath);;
					rpea.PrintPageEventArgs.Graphics.DrawPath(pen, gfxPath);
				}
			}
		}
示例#19
0
		public virtual void DrawShape(Graphics graphics, BaseLine line, Rectangle rectangle)
		{
			if (graphics == null) {
				throw new ArgumentNullException("graphics");
			}
			if (line == null) {
				throw new ArgumentNullException("line");
			}
			
			using (Pen pen = line.CreatePen(line.Thickness)){
				if (pen != null){
					GraphicsPath path1 = this.CreatePath(rectangle);
					graphics.DrawPath(pen, path1);
				}
			}
		}
示例#20
0
		public void DrawShape(PdfContentByte cb,
		                      BaseLine line,
		                      IBaseStyleDecorator style,
		                      Point from,Point to)
		{
			this.CreatePath(cb,line,style,from,to);
		}
示例#21
0
		public override void DrawShape(Graphics graphics, BaseLine line, Rectangle rectangle)
		{
			base.DrawShape(graphics, line, rectangle);
		}
示例#22
0
 public override void DrawShape(Graphics graphics, BaseLine line, Rectangle rectangle)
 {
     base.DrawShape(graphics, line, rectangle);
 }
示例#23
0
 public abstract void CreatePath(PdfContentByte contentByte,
                                 BaseLine line,
                                 IBaseStyleDecorator style,
                                 Point from,
                                 Point to);
示例#24
0
 public abstract void CreatePath(PdfContentByte contentByte,
                                 BaseLine line,
                                 IBaseStyleDecorator style,
                                 iTextSharp.text.Rectangle rectangle);
示例#25
0
		public void DrawShape(PdfContentByte cb,
		                      BaseLine line,
		                      IBaseStyleDecorator style,
		                      iTextSharp.text.Rectangle r)
		{
			this.CreatePath(cb,line,style,r);
		}
示例#26
0
		public abstract void CreatePath (PdfContentByte contentByte,
		                                 BaseLine line,
		                                 IBaseStyleDecorator style,
		                                 iTextSharp.text.Rectangle rectangle);
示例#27
0
		public abstract void CreatePath (PdfContentByte contentByte,
		                                 BaseLine line,
		                                 IBaseStyleDecorator style,
		                                 Point from,
		                                Point to);