0
我试图为我的列表视图和im绑定到一个实体列表建立一个项目模板。实体我有一个System.Drawing.Image
,我想要显示,但到目前为止,我不能为我的生活弄清楚如何将它绑定到<Image>
块。WPF内存中图像显示
每个实例和文档,我可以在互联网上找到涉及到HDD或在网站上通过uri
即文件访问图像
<DataTemplate x:Key="LogoPreviewItem">
<Border BorderBrush="Black" BorderThickness="1">
<DockPanel Width="150" Height="100">
<Image>
<Image.Source>
<!--
{Binding PreviewImage} is where the System.Drawing.Image
is in this context
-->
</Image.Source>
</Image>
<Label DockPanel.Dock="Bottom" Content="{Binding CustomerName}" />
</DockPanel>
</Border>
</DataTemplate>
看看http://stackoverflow.com/questions/686461/how-do-i-bind-a-byte-array-to-an-image-in-wpf-with-a-value-converter – volody 2010-06-10 20:04:30