本文整理汇总了C#中Panel.y1方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.y1方法的具体用法?C# Panel.y1怎么用?C# Panel.y1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel.y1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlotPanel
public PlotPanel(RenderState state)
{
this.state = state;
Plot = new Panel();
Left = new Panel();
Right = new Panel();
Top = new Panel();
Bottom = new Panel();
Overlay = new Panel();
Add(Plot);
Add(Left);
Add(Right);
Add(Top);
Add(Bottom);
Add(Overlay);
Plot.SetStroke(Color.Gray, 0.5).SetOrder(100000);
this.x0 = () => screen.Left;
this.y0 = () => screen.Top;
this.x1 = () => screen.Right - 1;
this.y1 = () => screen.Bottom - 1;
// flip y axis and put 0 at left
this.Transform = new Transform
{
transform = p => new PointF(p.X - (float)this.x0(), (float)this.y1() - p.Y),
untransform = p => new PointF(p.X + (float)this.x0(), (float)this.y1() + p.Y)
};
Overlay.x0 = () => 0;
Overlay.y0 = () => 0;
Overlay.x1 = () => this.Width();
Overlay.y1 = () => this.Height();
Overlay.Transform = new Transform
{
transform = p => new PointF((float)(p.X * Plot.Width()), (float)(p.Y * Plot.Height())),
untransform = p => new PointF((float)(p.X / Plot.Width()), (float)(p.Y / Plot.Height()))
};
Plot.x0 = () => state.MarginLeft;
Plot.y0 = () => state.MarginBottom;
Plot.x1 = () => this.Width() - state.MarginRight;
Plot.y1 = () => this.Height() - state.MarginTop;
Plot.Clip = true;
Plot.Transform = Transform.Range(state.XVisibleRange, state.YVisibleRange).Concat(new Transform
{
transform = p => new PointF((float)(p.X * Plot.Width()), (float)(p.Y * Plot.Height())),
untransform = p => new PointF((float)(p.X / Plot.Width()), (float)(p.Y / Plot.Height()))
});
Left.x0 = () => 0;
Left.y0 = () => state.MarginBottom;
Left.x1 = () => state.MarginLeft;
Left.y1 = () => this.Height() - state.MarginTop;
Left.Transform = Transform.Range(() => Range.Identity, state.YVisibleRange).Concat(new Transform
{
transform = p => new PointF((float)(p.X + Left.x1()), (float)(p.Y * Left.Height())),
untransform = p => new PointF((float)(p.X - Left.x1()), (float)(p.Y / Left.Height()))
});
Bottom.x0 = () => state.MarginLeft;
Bottom.y0 = () => 0;
Bottom.x1 = () => this.Width() - state.MarginRight;
Bottom.y1 = () => state.MarginBottom;
Bottom.Transform = Transform.Range(state.XVisibleRange, () => Range.Identity).Concat(new Transform
{
transform = p => new PointF((float)(p.X * Bottom.Width()), (float)(p.Y + Bottom.y1())),
untransform = p => new PointF((float)(p.X / Bottom.Width()), (float)(p.Y - Bottom.y1()))
});
//Right.Transform.Concat(Transform.Range(() =>Range.Identity, env.YVisibleRange));
//Top.Transform.Concat(Transform.Range(env.XVisibleRange, () => Range.Identity));
}