System.Drawing.Pen.Clone C# (CSharp) Méthode

Clone() public méthode

public Clone ( ) : object
Résultat object
        public object Clone()
        {
            if (brush != null)
                return new Pen (brush, width);
            else
                return new Pen (color, width);
        }

Usage Example

Exemple #1
0
 public static void DrawArrow(this FakeGraphics.FakeGraphics g, Pen pen, int x1, int y1, int x2, int y2)
 {
     Pen p = (Pen)pen.Clone();
     p.StartCap = LineCap.Round;
     p.EndCap = LineCap.Flat;
     g.DrawLine(pen, x1, y1, x2, y2);
     p.Width = 5;
     p.EndCap = LineCap.ArrowAnchor;
     int xx=x2, yy=y2;
     if (x1 == x2)
     {
         if (y1 > y2)
             yy += 5;
         else
             yy -= 5;
     }
     else
     {
         if (x1 > x2)
             xx += 5;
         else
             xx -= 5;
     }
     g.DrawLine(p, xx, yy, x2, y2);
 }
All Usage Examples Of System.Drawing.Pen::Clone