Example #1
0
        private List <Point> GetHandlePoints(SpectrumAnalyserHandle handle)
        {
            List <Point> returnValue = new List <Point>();
            var          xPos        = handle.Bin * Size.Width / _spectrumEngine.Bins;
            var          yPos        = handle.Level * Size.Height / 256;

            returnValue.Add(new Point(xPos, yPos));
            returnValue.Add(new Point(xPos, yPos - handle.LevelRange));
            returnValue.Add(new Point(xPos, yPos + handle.LevelRange));
            return(returnValue);
        }
Example #2
0
        private List <Rectangle> GetHandleRects(SpectrumAnalyserHandle handle, int handleRadius)
        {
            List <Rectangle> returnValue = new List <Rectangle>();
            var xPos = handle.Bin * Size.Width / _spectrumEngine.Bins;
            var yPos = handle.Level * Size.Height / 256;

            returnValue.Add(new Rectangle(xPos - handleRadius / 2, yPos - handleRadius / 2, handleRadius, handleRadius));
            handleRadius = handleRadius / 2;
            returnValue.Add(new Rectangle(xPos - handleRadius / 2, (yPos - handle.LevelRange) - handleRadius / 2, handleRadius, handleRadius));
            returnValue.Add(new Rectangle(xPos - handleRadius / 2, (yPos + handle.LevelRange) - handleRadius / 2, handleRadius, handleRadius));
            return(returnValue);
        }
Example #3
0
 private static void DrawHandleText(Graphics graphics, int fontSize, SpectrumAnalyserHandle handle, Brush fontBrush,
                                    Rectangle handleRect)
 {
     using (var font1 = new Font("Segoe UI", fontSize, FontStyle.Bold, GraphicsUnit.Point))
     {
         var stringFormat = new StringFormat
         {
             Alignment     = StringAlignment.Center,
             LineAlignment = StringAlignment.Center
         };
         graphics.DrawString(handle.Number.ToString(), font1, fontBrush, handleRect, stringFormat);
     }
 }