I have the following XAML code :
<Image Source="a.jpg" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"/>
and I, visually, got this :
(http://img810.imageshack.us/img810/2401/imagestretchuniform.png)
With Stretch="None"
, I got this :
(http://img28.imageshack.us/img28/1783/imagestretchnone.png)
Now, what I want is to center the Image vertically or horizontally with Stretch="Uniform"
! Only the "smallest" side (with Uniform
) will be centered, right. But at the moment, as you can see on screenshots, the Image is simply put in the top-left corner, even if I defined HorizontalAlignment
and VerticalAlignment
to "Center"
What should I do ?
the whole code is :
<UserControl [...]>
<Canvas Width="640" Height="480" Background="#FF881607">
<Image Source="a.jpg" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"/>
</Canvas>
</UserControl>