Image控件可以显示本地及远程图片。
附上代码:Stretch="Fill"
- <Image Height="300" Width="400" Margin="46,0,34,468" Source="/PhoneApp1;component/Images/psb4.jpeg" Stretch="Fill"></Image>
附上代码:Stretch="Uniform"
- <Image Height="300" HorizontalAlignment="Left" Width="400" Margin="46,345,34,123" Source="/PhoneApp1;component/Images/psb4.jpeg" Stretch="Uniform"></Image>
附上代码:Stretch="None"
- <Image Height="300" HorizontalAlignment="Left" Width="400" Margin="46,345,34,123" Source="/PhoneApp1;component/Images/psb4.jpeg" Stretch="None"></Image>
附上代码:
- <Image Height="300" HorizontalAlignment="Left" Width="400" Margin="46,345,34,123" Source="/PhoneApp1;component/Images/psb4.jpeg" Stretch="UniformToFill"></Image>
我们还可以对图片进行处理,eg:对图片进行剪裁特效。
附上代码:
- <Image Height="300" Margin="46,0,34,468" Source="/PhoneApp1;component/Images/psb4.jpeg" Stretch="Fill">
- <Image.Clip>
- <EllipseGeometry Center="200,200" RadiusX="100" RadiusY="400"></EllipseGeometry>
- </Image.Clip>
- </Image>
效果图:
转载于:https://blog.51cto.com/6685704/1167761