Пример #1
0
        public override void Draw(SequenceRenderer renderer, Graphics g)
        {
            int startTick = (renderer.AnimationFirstTick / 24) * 24;

            for (int tick = startTick; ; tick += 24)
            {
                var x0 = renderer.GetTickX(tick);
                var x1 = renderer.GetTickX(tick + 24);
                var b  = (tick / 96) % 2 == 0 ? renderer.whiteKey : renderer.blackKey;
                g.FillRectangle(b, x0, 0, x1 - x0, renderer.Image.Height);
                if (x1 > renderer.Image.Width)
                {
                    break;
                }
            }
        }
Пример #2
0
        public override void Draw(SequenceRenderer renderer, Graphics g)
        {
            for (int note = renderer.TopNote; note >= renderer.FirstNote && note >= 0; note--)
            {
                Brush b = SequenceRenderer.NoteIsSharp(note) ? renderer.blackKey : renderer.whiteKey;
                var   y = renderer.GetNoteY(note);
                g.FillRectangle(b, 0, y, renderer.Image.Width, renderer.NoteHeight);
            }

            for (int note = renderer.TopNote; note >= renderer.FirstNote && note >= 0; note--)
            {
                var y = renderer.GetNoteY(note);
                if (note % 12 == 0)
                {
                    g.DrawLine(renderer.grid1, 0, y + renderer.NoteHeight, renderer.Image.Width, y + renderer.NoteHeight);
                }
                else if (note % 12 == 5)
                {
                    g.DrawLine(renderer.grid2, 0, y + renderer.NoteHeight, renderer.Image.Width, y + renderer.NoteHeight);
                }
            }


            // draw beats and measures grid
            int top    = (int)Math.Max(0, renderer.GetNoteY(127));
            int bottom = (int)Math.Min(renderer.Image.Height, renderer.GetNoteY(-1));

            int startTick = (renderer.AnimationFirstTick / 24) * 24;

            for (int tick = startTick; ; tick += 24)
            {
                var tickx = renderer.GetTickX(tick);
                if ((tick / 24) % 4 == 0)
                {
                    g.DrawLine(renderer.grid1, tickx, top, tickx, bottom);
                }
                else
                {
                    g.DrawLine(renderer.grid3, tickx, top, tickx, bottom);
                }

                if (tickx > renderer.Image.Width)
                {
                    break;
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Actual background rendering by subclass.
 /// </summary>
 public abstract void Draw(SequenceRenderer renderer, Graphics g);
Пример #4
0
 public override void Draw(SequenceRenderer renderer, Graphics g)
 {
     throw new NotImplementedException();
 }