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