Ejemplo n.º 1
0
 /// <summary>
 /// Draws a line.
 /// </summary>
 /// <param name="pen">The stroke pen.</param>
 /// <param name="p1">The first point of the line.</param>
 /// <param name="p1">The second point of the line.</param>
 public void DrawLine(Pen pen, Perspex.Point p1, Perspex.Point p2)
 {
     if (pen != null)
     {
         using (var d2dBrush = pen.Brush.ToDirect2D(this.renderTarget))
         {
             this.renderTarget.DrawLine(p1.ToSharpDX(), p2.ToSharpDX(), d2dBrush);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Draws a line.
 /// </summary>
 /// <param name="pen">The stroke pen.</param>
 /// <param name="p1">The first point of the line.</param>
 /// <param name="p1">The second point of the line.</param>
 public void DrawLine(Pen pen, Perspex.Point p1, Perspex.Point p2)
 {
     if (pen != null)
     {
         using (SharpDX.Direct2D1.SolidColorBrush d2dBrush = this.Convert(pen.Brush))
         {
             this.renderTarget.DrawLine(p1.ToSharpDX(), p2.ToSharpDX(), d2dBrush);
         }
     }
 }