示例#1
0
		internal override PointCollection getOutlinePoly()
		{
			PointCollection poly = new PointCollection(0);
			GraphicsPath arrowPath = new GraphicsPath(FillMode.Alternate);

			// draw the arrow's line
			if (style == ArrowStyle.Bezier)
			{
				arrowPath.AddBeziers(points.getArray());
			}
			else
			{
				arrowPath.AddLines(points.getArray());
			}

			System.Drawing.Pen widenPen = new System.Drawing.Pen(Color.Black,
				2 * Constants.getMillimeter(flowChart.MeasureUnit));
			arrowPath.Widen(widenPen);
			arrowPath.Flatten();
			poly.AddRange(arrowPath.PathPoints);
			widenPen.Dispose();
			arrowPath.Dispose();

			return poly;
		}
示例#2
0
文件: Box.cs 项目: ChrisMoreton/Test3
		internal override PointCollection getOutlinePoly()
		{
			RectangleF br = BoundingRect;

			PointCollection points = new PointCollection(0);
			GraphicsPath gp = null;

			switch (style)
			{
				case BoxStyle.Rectangle:
				case BoxStyle.RoundedRectangle:
					points.Add(new PointF(br.Left, br.Top));
					points.Add(new PointF(br.Right, br.Top));
					points.Add(new PointF(br.Right, br.Bottom));
					points.Add(new PointF(br.Left, br.Bottom));
					break;
				case BoxStyle.Shape:
					gp = Shape.getPath(shapeData, rotation());
					gp.Flatten();
					points.AddRange(gp.PathPoints);
					gp.Dispose();
					break;
				case BoxStyle.Ellipse:
					points = Utilities.approxEllipse(br, 40);
					break;
				case BoxStyle.Rhombus:
					// calculate the vertex coordinates
					points.Add(new PointF((br.Left + br.Right) / 2, br.Top));
					points.Add(new PointF(br.Right, (br.Top + br.Bottom) / 2));
					points.Add(new PointF((br.Left + br.Right) / 2, br.Bottom));
					points.Add(new PointF(br.Left, (br.Top + br.Bottom) / 2));
					break;
				case BoxStyle.Delay:
					gp = Utilities.getDelaySymbol(br);
					gp.Flatten();
					points.AddRange(gp.PathPoints);
					gp.Dispose();
					break;
			}

			return points;
		}