我为 mjpg 流式传输开发了一个 WPF 应用程序。我在这里包含代码
public partial class MainWindow : Window
{
MjpegDecoder _mjpeg;
public MainWindow()
{
InitializeComponent();
_mjpeg = new MjpegDecoder();
_mjpeg.FrameReady += _mjpeg_FrameReady;
}
void _mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
{
// What to write to get BitmapImage
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
_mjpeg.ParseStream(new Uri("http://155.41.145.37/mjpg/video.mjpg"));
}
}
我需要写什么来获取位图frameReadyEventArgs
以及如何将该位图分配给 WPFImage
控件