【发布时间】:2012-03-21 23:33:57
【问题描述】:
您好,我正在尝试将图像的角变圆,或者将我的边框重叠在图像的顶部,但我尝试的任何方法似乎都不起作用。
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
WindowStartupLocation="CenterScreen"
BorderThickness="0,0,0,0"
Background="Transparent"
Title="MainWindow" Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="581" d:DesignWidth="733" SizeToContent="WidthAndHeight">
<Border BorderThickness="6" BorderBrush="Black" CornerRadius="12" Padding="0.5"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Image Height="543" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="711" Source="/WpfApplication1;component/Images/Login.jpg" ImageFailed="image1_ImageFailed" />
<TextBox Height="38" HorizontalAlignment="Left" Margin="205,177,0,0" Name="textBox1" VerticalAlignment="Top" Width="299" Background="#00000000" BorderBrush="#00000000" BorderThickness="0" Text="Please enter your email address." FontSize="18" Foreground="White" TextChanged="textBox1_TextChanged" />
<TextBox Background="#00000000" BorderBrush="#00000000" BorderThickness="0" FontSize="18" Foreground="White" Height="38" HorizontalAlignment="Left" Margin="205,256,0,0" Name="textBox2" Text="Please enter your password" VerticalAlignment="Top" Width="299" />
</Grid>
</Border>
</Window>
是否可以在网格上重叠边框?
你可以从这个屏幕转储中明白我的意思:
【问题讨论】: