本文整理汇总了C#中Line.set_Y2方法的典型用法代码示例。如果您正苦于以下问题:C# Line.set_Y2方法的具体用法?C# Line.set_Y2怎么用?C# Line.set_Y2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Line
的用法示例。
在下文中一共展示了Line.set_Y2方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LineAdjust1PixelsWidth
private void LineAdjust1PixelsWidth(Line l)
{
l.set_X1(l.get_X1() + 0.5);
l.set_X2(l.get_X2() + 0.5);
l.set_Y1(l.get_Y1() + 0.5);
l.set_Y2(l.get_Y2() + 0.5);
}
示例2: LineClone
private Line LineClone(Line line)
{
Line line2 = new Line();
line2.set_X1(line.get_X1());
line2.set_X2(line.get_X2());
line2.set_Y1(line.get_Y1());
line2.set_Y2(line.get_Y2());
return line2;
}
示例3: DrawStationTimeScale
private void DrawStationTimeScale(double y, List<MarkerData> ls, bool big)
{
double num = big ? 4.5 : 2.0;
foreach (MarkerData data in ls)
{
if (data.Style == PositionMarkerStyle.MarkerStation)
{
Line l = new Line();
l.set_X1(data.Position - num);
l.set_Y1(y);
l.set_X2(data.Position + num);
l.set_Y2(y);
this.LineAdjust1PixelsWidth(l);
l.set_Width(1251.0);
l.set_Height(this.CanvasRoot_ActualHeight);
l.set_StrokeThickness(1.0);
l.set_Stroke(new SolidColorBrush(_SilverlightHelper.ConvertToColor(data.Color)));
this.CanvasRoot.get_Children().Add(l);
}
}
}
示例4: DrawStation
private void DrawStation(MarkerData s, Rectangle rc)
{
if (s.Visible)
{
Line l = new Line();
l.set_X1((double) s.Position);
l.set_X2((double) s.Position);
l.set_Y1((double) rc.Y);
l.set_Y2(this.CanvasRoot_ActualHeight - rc.Y);
l.set_Width(1251.0);
l.set_Height(this.CanvasRoot_ActualHeight);
if (s.Style == PositionMarkerStyle.MarkerStation)
{
l.set_StrokeThickness(2.0);
}
else if (s.Style == PositionMarkerStyle.MarkerIntermediateStop)
{
l.get_StrokeDashArray().Add(2.0);
l.get_StrokeDashArray().Add(2.0);
l.set_StrokeThickness(2.0);
}
else if (s.Style == PositionMarkerStyle.MarkerSegmentBorder)
{
l.set_StrokeThickness(1.0);
}
else
{
l.set_StrokeThickness(2.0);
}
l.set_Stroke(new SolidColorBrush(_SilverlightHelper.ConvertToColor(s.Color)));
this.LineAdjust1PixelsWidth(l);
this.CanvasRoot.get_Children().Add(l);
}
}
示例5: DrawHorScaleLine
private void DrawHorScaleLine(Rectangle rc, double y)
{
Line line = new Line();
int x = rc.X;
line.set_X1((double) x);
line.set_Y1(y);
line.set_X2(this.Position2PointX(rc.Width, rc) + x);
line.set_Y2(y);
line.set_Width(1251.0);
line.set_Height(this.CanvasRoot_ActualHeight);
line.set_StrokeThickness(1.0);
line.set_Stroke(new SolidColorBrush(ColorConstants.LightGray));
this.CanvasRoot.get_Children().Add(line);
}
示例6: DrawCurve
private void DrawCurve(TrainCurveData c, Rectangle rc, List<Line> rectangles, int startIndex)
{
if ((c != null) && (c.Points != null))
{
PointData data;
PointData data2;
int num = 0;
int num2 = -1;
Line item = new Line();
Color color = Colors.get_Black();
double widthRequires = 0.0;
if (c.Points.Count > 0)
{
widthRequires = this.DrawCurveTitle(rc, c.Points[0], c.Points[0], c.Caption, false);
}
for (int i = startIndex; i < (c.Points.Count - 1); i++)
{
data = c.Points[i];
data2 = c.Points[i + 1];
if (!c.Regular)
{
TimeSpan span = (TimeSpan) (data.DateTime - data2.DateTime);
if (this.IsGap((double) (data.Position - data2.Position), span.TotalMinutes))
{
c.CaptionHasDrawn = false;
c.CaptionStartIndex = i + 1;
continue;
}
}
color = _SilverlightHelper.ConvertToColor(data2.Color);
Line line2 = new Line();
line2.set_X1(this.Position2PointX(data.Position, rc));
line2.set_Y1(this.DateTime2PointY(data.DateTime, rc));
line2.set_X2(this.Position2PointX(data2.Position, rc));
line2.set_Y2(this.DateTime2PointY(data2.DateTime, rc));
line2.set_Width(1251.0);
line2.set_Height(this.CanvasRoot_ActualHeight);
line2.set_StrokeThickness(2.0);
line2.set_Stroke(new SolidColorBrush(color));
this.CanvasRoot.get_Children().Add(line2);
if (c.Regular && (c.Caption.Length > 0))
{
if (!this.HasInsersection(rectangles, line2))
{
int num5 = data2.Position - data.Position;
if (num5 > num)
{
num = num5;
num2 = i;
item = this.LineClone(line2);
}
}
}
else if (!c.CaptionHasDrawn)
{
int num6;
int num7;
int num8;
bool flag;
if (this.GetGoodPointsForTitle(c, c.CaptionStartIndex, rc, widthRequires, out num6, out num7, out num8, out flag))
{
c.CaptionHasDrawn = true;
this.DrawCurveTitle(rc, c.Points[num6], c.Points[num7], c.Caption, true);
}
else if (flag)
{
c.CaptionStartIndex = num8;
}
}
}
if ((c.Regular && (c.Caption.Length > 0)) && (num2 != -1))
{
data = c.Points[num2];
data2 = c.Points[num2 + 1];
color = _SilverlightHelper.ConvertToColor(data2.Color);
if (rectangles != null)
{
rectangles.Add(item);
}
Point point = new Point();
Point point2 = new Point();
point.set_X(this.Position2PointX(data.Position, rc));
point.set_Y(this.DateTime2PointY(data.DateTime, rc));
point2.set_X(this.Position2PointX(data2.Position, rc));
point2.set_Y(this.DateTime2PointY(data2.DateTime, rc));
double rotationAngle = _SilverlightHelper.GetRotationAngle(point, point2);
double num10 = point2.get_X() - point.get_X();
TextBlock block = new TextBlock();
block.SetValue(Canvas.TopProperty, point.get_Y() + 5.0);
block.SetValue(Canvas.LeftProperty, point.get_X());
block.SetValue(FrameworkElement.WidthProperty, num10);
block.SetValue(FrameworkElement.HeightProperty, 50.0);
block.set_Width(num10);
block.set_Text(c.Caption);
block.set_FontSize(17.0);
block.set_FontFamily(new FontFamily("Arial"));
block.set_Foreground(new SolidColorBrush(color));
block.set_FontStyle(FontStyles.get_Normal());
block.set_FontWeight(FontWeights.get_Bold());
RotateTransform transform = new RotateTransform();
//.........这里部分代码省略.........
示例7: IntersectionOf
public static bool IntersectionOf(Line line1, Line line2)
{
if (((line1.get_X1() == line1.get_X2()) && (line1.get_Y1() == line1.get_Y2())) || ((line2.get_X1() == line2.get_X2()) && (line2.get_Y1() == line2.get_Y2())))
{
return false;
}
if (((line1.get_X1() != line2.get_X1()) || (line1.get_Y1() != line2.get_Y1())) && ((line1.get_X2() != line2.get_X1()) || (line1.get_Y2() != line2.get_Y1())))
{
if (((line1.get_X1() == line2.get_X2()) && (line1.get_Y1() == line2.get_Y2())) || ((line1.get_X2() == line2.get_X2()) && (line1.get_Y2() == line2.get_Y2())))
{
return true;
}
line1.set_X2(line1.get_X2() - line1.get_X1());
line1.set_Y2(line1.get_Y2() - line1.get_Y1());
line2.set_X1(line2.get_X1() - line1.get_X1());
line2.set_Y1(line2.get_Y1() - line1.get_Y1());
line2.set_X2(line2.get_X2() - line1.get_X1());
line2.set_Y2(line2.get_Y2() - line1.get_Y1());
double num = Math.Sqrt((line1.get_X2() * line1.get_X2()) + (line1.get_Y2() * line1.get_Y2()));
double num2 = line1.get_X2() / num;
double num3 = line1.get_Y2() / num;
double num4 = (line2.get_X1() * num2) + (line2.get_Y1() * num3);
line2.set_Y1((line2.get_Y1() * num2) - (line2.get_X1() * num3));
line2.set_X1(num4);
num4 = (line2.get_X2() * num2) + (line2.get_Y2() * num3);
line2.set_Y2((line2.get_Y2() * num2) - (line2.get_X2() * num3));
line2.set_X2(num4);
if (((line2.get_Y1() < 0.0) && (line2.get_Y2() < 0.0)) || ((line2.get_Y1() >= 0.0) && (line2.get_Y2() >= 0.0)))
{
return false;
}
double num5 = line2.get_X2() + (((line2.get_X1() - line2.get_X2()) * line2.get_Y2()) / (line2.get_Y2() - line2.get_Y1()));
if ((num5 < 0.0) || (num5 > num))
{
return false;
}
}
return true;
}