本文整理汇总了C#中System.Windows.Shapes.Line.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Line.SetValue方法的具体用法?C# Line.SetValue怎么用?C# Line.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Shapes.Line
的用法示例。
在下文中一共展示了Line.SetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromPoints
public Line FromPoints(Point p1, Point p2)
{
var line = new Line { X1 = p1.X, Y1 = p1.Y, X2 = p2.X, Y2 = p2.Y, Stroke = Brushes.Wheat, StrokeThickness = 3, SnapsToDevicePixels = true };
line.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);
Canvas.SetTop(line, p1.Y);
Canvas.SetLeft(line, p1.X);
Canvas.SetBottom(line, p2.Y);
Canvas.SetRight(line, p2.X);
return line;
}
示例2: draw_axis
void draw_axis(Point start, Point end)
{
var line = new Line();
line.X1 = start.X;
line.Y1 = start.Y;
line.X2 = end.X;
line.Y2 = end.Y;
line.Stroke = Brushes.Black;
line.StrokeThickness = 1;
line.SnapsToDevicePixels = true;
line.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);
canvas.Children.Add(line);
}
示例3: DrawLineSegment
private void DrawLineSegment( double startX, double startY, double endX, double endY, double lineWidth )
{
var line = new Line();
line.Stroke = System.Windows.Media.Brushes.Black;
line.X1 = startX;
line.X2 = endX;
line.Y1 = startY;
line.Y2 = endY;
line.StrokeThickness = lineWidth;
line.SnapsToDevicePixels = true;
line.SetValue( RenderOptions.EdgeModeProperty, EdgeMode.Aliased );
DrawingArea.Children.Add( line );
}