在 System.Windows.Controls.Image 控件中显示 System.Drawing.Bitmap 对象
我有一个图像控件:
<Image Height="209" HorizontalAlignment="Left" Margin="66,74,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" />
在 wpf 应用程序中。我导入了一个将视频转换为位图图像的库,我试图将这些位图放入图像控制中。有一个方法返回 System.Drawing.Bitmap 对象,我想在 image1 中显示该位图。我怎么能这么做呢?
I have an image control as:
<Image Height="209" HorizontalAlignment="Left" Margin="66,74,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" />
in a wpf application. I imported a library that converts a video to bitmap images and I am trying to place those bitmaps in the image countrol. There is a method that returns a System.Drawing.Bitmap object and I want to display that bitmap in image1. How could I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先将其转换为某种
ImageSource
。请参阅此问题。您可以使用
ValueConverter
在绑定本身中动态执行此操作。You need to convert it to an
ImageSource
of some kind first. See this question.You can use a
ValueConverter
to do this on the fly in the binding itself.