private void GraphViewPanel_Paint(object sender, PaintEventArgs e) { if (CanPaintWaveGraph) { int rate = Convert.ToInt32(PlottingRateValue.Text); // 441 = averaging rate(픽셀당 441 샘플 평균) int samplePlot = (wPresenter.WavFS.nOfSamples / rate) + 1; SampAvgDatas = new float[samplePlot]; SampAvgDatas = wPresenter.SetViewSampleGraph(rate); wG = GraphViewPanel.CreateGraphics(); Pen greenPen = new Pen(Color.Green, (float)0.5); int h = GraphViewPanel.Height; for (int i = 0; i < samplePlot; i++) { int d = (h - (int)(SampAvgDatas[i] / 300)) / 2; // 중앙값을 평균값으로 만들어줌 wG.DrawLine(greenPen, (float)i / 2, d, (float)i / 2, d + (int)(SampAvgDatas[i] / 300)); } wG.Dispose(); } }
private void WavePlot_Click(object sender, EventArgs e) { CanPaintWaveGraph = true; GraphViewPanel.Invalidate(); }