public void DrawXLine(long Tick, Color LineColor, float LineWidth = 2, System.Drawing.Drawing2D.DashStyle LineStyle = System.Drawing.Drawing2D.DashStyle.Solid) { D2DGraphics g = baseEvent.D2DGraphics; long MinTick = pprops.PianoStartTick; long MaxTick = pprops.PianoStartTick + (long)Math.Round(pprops.dertPixel2dertTick(baseEvent.ClipRectangle.Width), 0) + 1; if (Tick <= MaxTick && Tick >= MinTick) { long ETick = Tick - MinTick;//获得左边界距离启绘点距离; if (ETick >= 0) { long NodeXPixel = baseEvent.ClipRectangle.X + (int)Math.Round(pprops.dertTick2dertPixel(ETick), 0); g.DrawLine(new Point((int)NodeXPixel, baseEvent.ClipRectangle.Top), new Point((int)NodeXPixel, baseEvent.ClipRectangle.Bottom), LineColor, LineWidth, LineStyle); } } }
internal void CalcAxis(TrackerProperties pprops, TrackerConfigures rconf) { if (_me.Y <= rconf.Const_TitleHeight && _me.Y >= 0) { _area = AreaType.Title; } else if (_me.X <= rconf.Const_GridWidth && _me.X >= 0) { _area = AreaType.Roll; } else { _area = AreaType.Track; } if (_area != AreaType.Title) { double drawed_noteSpt = (double)(_me.Y - rconf.Const_TitleHeight) / rconf.Const_TrackHeight; _trackID = (int)Math.Floor(drawed_noteSpt) + (int)pprops.TopTrackId; } if (_area != AreaType.Roll) { long drawed_pixel = _me.X - rconf.Const_GridWidth; _tick = (long)Math.Round((pprops.PianoStartTick + pprops.dertPixel2dertTick(drawed_pixel)), 0); } }