Пример #1
0
 protected override void InnerDraw(Graphics g, int useLength)
 {
     for (int i = 0; i < useLength; i++)
     {
         float x      = DisplayRectangle.NormalizedWidth((float)i / useLength);
         float height =
             DisplayRectangle.NormalizedHeight(SpectrumValues[i]);
         g.FillRectangle(Brush, DisplayRectangle.Left + x, DisplayRectangle.Bottom - height, 1, height);
     }
 }
Пример #2
0
        protected override void InnerDraw(Graphics g, int useLength)
        {
            float lastX = 0f;
            float lastY = DisplayRectangle.Bottom;

            for (int i = 0; i < useLength; i++)
            {
                float x      = DisplayRectangle.NormalizedWidth((float)i / useLength);
                float height =
                    DisplayRectangle.NormalizedHeight(SpectrumValues[i]);
                var y = DisplayRectangle.Bottom - height;
                g.DrawLine(_pen, lastX, lastY, x, y);

                lastX = x;
                lastY = y;
            }
        }