Esempio n. 1
0
        private static void Render(BitmapHelper.RenderInfo info, SpectrumRendererData rendererData)
        {
            var elements = rendererData.Elements;
            var peaks    = rendererData.Peaks;

            BitmapHelper.Clear(info);

            for (var a = 0; a < rendererData.Count; a++)
            {
                BitmapHelper.DrawRectangle(
                    info,
                    elements[a].X,
                    elements[a].Y,
                    elements[a].Width,
                    elements[a].Height
                    );
                if (peaks != null)
                {
                    if (peaks[a].Y >= elements[a].Y)
                    {
                        continue;
                    }
                    BitmapHelper.DrawRectangle(
                        info,
                        peaks[a].X,
                        peaks[a].Y,
                        peaks[a].Width,
                        peaks[a].Height
                        );
                }
            }
        }
Esempio n. 2
0
 public static void RenderSeperate(WaveFormRendererData rendererData, BitmapHelper.RenderInfo waveRenderInfo, BitmapHelper.RenderInfo powerRenderInfo, bool rms)
 {
     if (rms)
     {
         var waveElements  = rendererData.WaveElements;
         var powerElements = rendererData.PowerElements;
         for (var position = 0; position < rendererData.Position; position++)
         {
             for (var channel = 0; channel < rendererData.Channels; channel++)
             {
                 var waveElement  = waveElements[position, channel];
                 var powerElement = powerElements[position, channel];
                 BitmapHelper.DrawRectangle(
                     waveRenderInfo,
                     position,
                     waveElement.Y,
                     1,
                     waveElement.Height
                     );
                 BitmapHelper.DrawRectangle(
                     powerRenderInfo,
                     position,
                     powerElement.Y,
                     1,
                     powerElement.Height
                     );
             }
         }
     }
     else
     {
         var elements = rendererData.WaveElements;
         for (var position = 0; position < rendererData.Position; position++)
         {
             for (var channel = 0; channel < rendererData.Channels; channel++)
             {
                 var element = elements[position, channel];
                 BitmapHelper.DrawRectangle(
                     waveRenderInfo,
                     position,
                     element.Y,
                     1,
                     element.Height
                     );
             }
         }
     }
 }
Esempio n. 3
0
        private static void Render(BitmapHelper.RenderInfo valueRenderInfo, BitmapHelper.RenderInfo rmsRenderInfo, PeakRendererData rendererData)
        {
            var valueElements = rendererData.ValueElements;
            var rmsElements   = rendererData.RmsElements;
            var peakElements  = rendererData.PeakElements;
            var orientation   = rendererData.Orientation;

            BitmapHelper.Clear(valueRenderInfo);

            if (valueElements != null)
            {
                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 (orientation == Orientation.Horizontal)
                        {
                            if (peakElements[a].X > valueElements[a].Width)
                            {
                                BitmapHelper.DrawRectangle(
                                    valueRenderInfo,
                                    peakElements[a].X,
                                    peakElements[a].Y,
                                    peakElements[a].Width,
                                    peakElements[a].Height
                                    );
                            }
                        }
                        else if (orientation == Orientation.Vertical)
                        {
                            if (peakElements[a].Y < valueElements[a].Y)
                            {
                                BitmapHelper.DrawRectangle(
                                    valueRenderInfo,
                                    peakElements[a].X,
                                    peakElements[a].Y,
                                    peakElements[a].Width,
                                    peakElements[a].Height
                                    );
                            }
                        }
                    }
                }
            }
        }
        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
                        );
                }
            }
        }