コード例 #1
0
ファイル: RectangleShape.cs プロジェクト: hpsa/SharpDevelop
		//	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
ファイル: EllipseShape.cs プロジェクト: nylen/SharpDevelop
		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
ファイル: Border.cs プロジェクト: Bombadil77/SharpDevelop
		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
ファイル: LineShape.cs プロジェクト: nylen/SharpDevelop
		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
ファイル: BaseShape.cs プロジェクト: Bombadil77/SharpDevelop
		// 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
ファイル: BaseShape.cs プロジェクト: Rpinski/SharpDevelop
		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
ファイル: BaseShape.cs プロジェクト: Bombadil77/SharpDevelop
		public void DrawShape(PdfContentByte cb,
		                      BaseLine line,
		                      IBaseStyleDecorator style,
		                      Point from,Point to)
		{
			this.CreatePath(cb,line,style,from,to);
		}
コード例 #21
0
ファイル: RectangleShape.cs プロジェクト: hpsa/SharpDevelop
		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
ファイル: BaseShape.cs プロジェクト: Bombadil77/SharpDevelop
		public void DrawShape(PdfContentByte cb,
		                      BaseLine line,
		                      IBaseStyleDecorator style,
		                      iTextSharp.text.Rectangle r)
		{
			this.CreatePath(cb,line,style,r);
		}
コード例 #26
0
ファイル: BaseShape.cs プロジェクト: Bombadil77/SharpDevelop
		public abstract void CreatePath (PdfContentByte contentByte,
		                                 BaseLine line,
		                                 IBaseStyleDecorator style,
		                                 iTextSharp.text.Rectangle rectangle);
コード例 #27
0
ファイル: BaseShape.cs プロジェクト: Bombadil77/SharpDevelop
		public abstract void CreatePath (PdfContentByte contentByte,
		                                 BaseLine line,
		                                 IBaseStyleDecorator style,
		                                 Point from,
		                                Point to);