Esempio n. 1
0
 private static void RenderMono(BitmapHelper.RenderInfo info, Int32Point[,] elements, int width)
 {
     for (var x = 0; x < width - 1; x++)
     {
         var point1 = elements[0, x];
         var point2 = elements[0, x + 1];
         BitmapHelper.DrawLine(
             info,
             point1.X,
             point1.Y,
             point2.X,
             point2.Y
             );
     }
 }
Esempio n. 2
0
 private static void RenderSeperate(BitmapHelper.RenderInfo info, Int32Point[,] elements, int channels, int width)
 {
     for (var channel = 0; channel < channels; channel++)
     {
         for (var x = 0; x < width - 1; x++)
         {
             var point1 = elements[channel, x];
             var point2 = elements[channel, x + 1];
             BitmapHelper.DrawLine(
                 info,
                 point1.X,
                 point1.Y,
                 point2.X,
                 point2.Y
                 );
         }
     }
 }
        private static void Render(BitmapHelper.RenderInfo valueRenderInfo, BitmapHelper.RenderInfo rmsRenderInfo, BitmapHelper.RenderInfo crestRenderInfo, SpectrumRendererData rendererData)
        {
            var valueElements = rendererData.ValueElements;
            var rmsElements   = rendererData.RmsElements;
            var crestPoints   = rendererData.CrestPoints;
            var peakElements  = rendererData.PeakElements;

            BitmapHelper.Clear(valueRenderInfo);

            for (var a = 0; a < valueElements.Length; a++)
            {
                BitmapHelper.DrawRectangle(
                    valueRenderInfo,
                    valueElements[a].X,
                    valueElements[a].Y,
                    valueElements[a].Width,
                    valueElements[a].Height
                    );
                if (rmsElements != null)
                {
                    if (rmsElements[a].Height > 0)
                    {
                        BitmapHelper.DrawRectangle(
                            rmsRenderInfo,
                            rmsElements[a].X,
                            rmsElements[a].Y,
                            rmsElements[a].Width,
                            rmsElements[a].Height
                            );
                    }
                }
                if (peakElements != null)
                {
                    if (peakElements[a].Y < valueElements[a].Y)
                    {
                        BitmapHelper.DrawRectangle(
                            valueRenderInfo,
                            peakElements[a].X,
                            peakElements[a].Y,
                            peakElements[a].Width,
                            peakElements[a].Height
                            );
                    }
                }
            }

            if (crestPoints != null)
            {
                for (var a = 0; a < crestPoints.Length - 1; a++)
                {
                    var point1 = crestPoints[a];
                    var point2 = crestPoints[a + 1];
                    BitmapHelper.DrawLine(
                        crestRenderInfo,
                        point1.X,
                        point1.Y,
                        point2.X,
                        point2.Y
                        );
                }
            }
        }