图像控制拉伸属性在Windows Phone 8中不起作用

时间:2013-08-01 06:44:53

标签: windows-phone-8

我只是试图在我的Windows Phone 8应用程序中将BitMapImage绑定为Image控件的源代码。并将Stretch属性应用于Uniform。但图像仍显示拉长。如何将图像放入原始尺寸中。

这是我的代码:

<Image x:Name="ConversationImage" Width="200" Height="200" Visibility="{Binding ImageVisibility}" Source="{Binding ThumbImage}" Stretch="Uniform"  VerticalAlignment="Center" HorizontalAlignment="Center"/>

1 个答案:

答案 0 :(得分:1)

你好Deepak你的图像显示为拉伸,因为你将strech属性设置为均匀如果它是原始维度只是将拉伸属性设置为无..

<Image x:Name="ConversationImage" Width="200" Height="200" Visibility="{Binding ImageVisibility}" Source="{Binding ThumbImage}" Stretch="None"  VerticalAlignment="Center" HorizontalAlignment="Center"/>

如果您希望它始终保持原始尺寸,只需删除图像控件的宽度和高度。

相关问题