我有这个
BitmapSource source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(),
IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
我如何使用它以某种方式将其用作WPF Image
的源?
请提供代码示例。
谢谢!
最佳答案
BitmapSource
派生自 ImageSource
,因此您可以将其直接分配给 Image
的 Source
属性。
关于c# - BitmapSource 作为图像控件的源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9504397/