Exemplo n.º 1
0
 internal static void AddCornerArc(GraphicsPath path, Rectangle bounds, int cornerDiameter, eCornerArc corner)
 {
     ArcData a = GetCornerArc(bounds, cornerDiameter, corner);
     path.AddArc(a.X, a.Y, a.Width, a.Height, a.StartAngle, a.SweepAngle);
 }
Exemplo n.º 2
0
		internal static ArcData GetCornerArc(Rectangle bounds, int cornerDiameter, eCornerArc corner)
		{
			ArcData a;
			int diameter=cornerDiameter*2;
			switch(corner)
			{
				case eCornerArc.TopLeft:
					a=new ArcData(bounds.X,bounds.Y,diameter,diameter,180,90);
					break;
                case eCornerArc.TopRight:
					a=new ArcData(bounds.Right-diameter,bounds.Y,diameter,diameter,270,90);
					break;
				case eCornerArc.BottomLeft:
					a=new ArcData(bounds.X,bounds.Bottom-diameter,diameter,diameter,90,90);
					break;
				default: // eCornerArc.BottomRight:
					a=new ArcData(bounds.Right-diameter,bounds.Bottom-diameter,diameter,diameter,0,90);
					break;
			}
			return a; 
		}
Exemplo n.º 3
0
 public static void AddCornerArc(GraphicsPath path, Rectangle bounds, int cornerDiameter, eCornerArc corner)
 {
     if (cornerDiameter > 0)
     {
         ArcData a = GetCornerArc(bounds, cornerDiameter, corner);
         path.AddArc(a.X, a.Y, a.Width, a.Height, a.StartAngle, a.SweepAngle);
     }
     else
     {
         if (corner == eCornerArc.TopLeft)
         {
             path.AddLine(bounds.X, bounds.Y + 2, bounds.X, bounds.Y);
         }
         else if (corner == eCornerArc.BottomLeft)
         {
             path.AddLine(bounds.X + 2, bounds.Bottom, bounds.X, bounds.Bottom);
         }
         else if (corner == eCornerArc.TopRight)
         {
             path.AddLine(bounds.Right - 2, bounds.Y, bounds.Right, bounds.Y);
         }
         else if (corner == eCornerArc.BottomRight)
         {
             path.AddLine(bounds.Right, bounds.Bottom - 2, bounds.Right, bounds.Bottom);
         }
     }
 }