private void onEffectDrawn(object o, EventArgs e) { if (saoPlayer.isPlay()) { specturm.Source = BitMap.ChangeBitmapToImageSource(saoPlayer.getVisual().CreateSpectrumLinePeak(saoPlayer.getStream(), Draw_Width, Draw_Height, DrawColor1, DrawColor2, PeakColor, DrawBackgound, LineWidth, 3, 1, 30, false, false, true)); } else { effectTimer.Stop(); } //window.Content = this.Content = "W: " + Draw_Width + "H: " + Draw_Height; }
private void onEffectDrawn(object o, EventArgs e) { //if (saoPlayer.isPlay()) specturm.Source = BitMap.CreateBitmapSourceFromBitMap(saoPlayer.getVisual().CreateSpectrumLinePeak(saoPlayer.getStream(), Draw_Width, Draw_Height, DrawColor1, DrawColor2, PeakColor, DrawBackgound, LineWidth, 3, 1, 30, false, false, true)); if (saoPlayer.isPlay()) { specturm.Source = BitMap.ChangeBitmapToImageSource(saoPlayer.getVisual().CreateSpectrumLinePeak(saoPlayer.getStream(), Draw_Width, Draw_Height, DrawColor1, DrawColor2, PeakColor, DrawBackgound, LineWidth, 3, 1, 30, false, false, true)); } else { effectTimer.Stop(); observersOnStop(); } }
public SpectrumWidget(SAOPlayer sPlayer) { InitializeComponent(); saoPlayer = sPlayer; //频谱计时器 effectTimer = new DispatcherTimer(); effectTimer.Interval = TimeSpan.FromMilliseconds(1); effectTimer.Tick += onEffectDrawn; if (saoPlayer.isPlay()) { onPlay(); } }