c#wpf怎么设置image控件边框
<Border Width="100" Height="100" BorderBrush="Blue" BorderThickness="5">
<Image Source="pack://application:,,,/Capture.jpg"/>
</Border>
这个不行。。试过了 展开
外面套个Border是可以的,代码:
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid Margin="32">
<Border BorderBrush="Blue" BorderThickness="4">
<Image Source="/WpfApplication2;component/Images/Desert.jpg" />
</Border>
</Grid>
</Window>
截图:
按照你的代码定义Border的大小也没有问题,代码:
<Grid Margin="32">
<Border Height="100" Width="100" BorderBrush="Blue" BorderThickness="5">
<Image Source="/WpfApplication2;component/Images/Desert.jpg" />
</Border>
</Grid>
截图:
希望对你有帮助,有疑问请追问或是Hi