我有一个图像控件:
<Image Height="209" HorizontalAlignment="Left" Margin="66,74,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" />
在 wpf 应用程序中。我导入了一个将视频转换为位图图像的库,我试图将这些位图放在图像计数器中。有一个返回 System.Drawing.Bitmap 对象的方法,我想在 image1 中显示该位图。我怎么能那样做?
最佳答案
您需要先将其转换为某种类型的 ImageSource
。参见 this question。
您可以使用 ValueConverter
在绑定(bind)本身中即时执行此操作。
关于c# - 在 System.Windows.Controls.Image 控件中显示 System.Drawing.Bitmap 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6230826/