Exemplo n.º 1
0
        // static NoiseAnalyserFilter noiseFilterVowelChecker = new NoiseAnalyserFilter(7, 50, 3);
        public static void DrawIntensity(int zoom, Bitmap bmp, IntensityAnalyserFilter filter)
        {
            Graphics g = Graphics.FromImage(bmp);


            Point[] linePoints = new Point[Math.Min(800 / zoom, Math.Min(GramUtils.Archive.Count, 800))];


            // g.FillRectangle(Brushes.White, 0, 0, 1024, 800);
            int from = Math.Max(GramUtils.Archive.Count - 800, 0);
            int j = 0; float step = 1;

            for (int row = GramUtils.Archive.Count - 1; row >= from; row--)
            {
                // zoom = int.Parse(cmbZoom.SelectedItem.ToString().Replace("x", ""));
                //int amp = int.Parse(cmdAmp.SelectedItem.ToString().Replace("x", ""));


                //  for (int x = 0; x < GramUtils.Archive[row].Length / 2; x++)
                // {
                if ((j + 1) * zoom >= 800)
                {
                    break;
                }
                filter.ProcessData(null, SampleArchive[row]);

                linePoints[j].X = (int)(filter.Avg * 1000.0);
                linePoints[j].Y = (int)(j * zoom);
                ;
                /// for (int hj = (int)(j * zoom); hj < (j * zoom) + zoom; hj++)
                //bmp.SetPixel((int)(filter.avg * 500.0), (j * zoom), Color.Blue);



                //}
                j++;
            }
            linePoints[0].X = 0;
            linePoints[linePoints.Length - 1].X = 0;
            g.DrawPolygon(Pens.Blue, linePoints);
            g.Dispose();
        }