jjzjj

bitmapsource

全部标签

c# - 快速将 Bitmap 转换为 BitmapSource wpf

我需要以30Hz的频率在Image组件上绘制图像。我使用这段代码:publicMainWindow(){InitializeComponent();Messenger.Default.Register(this,(bmp)=>{ImageTarget.Dispatcher.BeginInvoke((Action)(()=>{varhBitmap=bmp.GetHbitmap();vardrawable=System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap,IntPtr.Zero,Int32Rect.Em
12