WPF印章水印, Border怎么悬浮在其他控件上面,类似盖章一样

需要使用Border然后放到Grid里面,
使用Grid容器(同网格层叠,最简单)

Grid的子元素会按照声明顺序后声明的覆盖先声明的,且可以通过Margin/HorizontalAlignment/VerticalAlignment控制Border的位置,实现悬浮效果。

bash 复制代码
<UserControl.Resources>
        <!--  透明色 -->
        <SolidColorBrush x:Key="gzColor" Color="#00F437" Opacity="0.1"/>

</UserControl.Resources>
<Grid>

<!--水印,已签到盖章-->                
<Border Width="77" Height="77" CornerRadius="150" BorderBrush="#00AF08"
                    Margin="0,80,5,0"
         HorizontalAlignment="Right" 
VerticalAlignment="Top"
BorderThickness="4" Padding="2">
                <Border 
         Width="64" Height="64"     
 Background="{StaticResource gzColor}" 
BorderBrush="#00AF08"
BorderThickness="2"
CornerRadius="80"
RenderTransformOrigin=".5,.5"
Visibility="Visible">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <TranslateTransform X="0.7" Y="0.5"  />
                            <RotateTransform Angle="-40" CenterX=".5" CenterY=".5" />
                        </TransformGroup>
                    </Border.RenderTransform>
                    <TextBlock Margin="5,0"
       Foreground="#00AF08" FontWeight="Bold" FontSize="17"
       Text="已签到" />
                </Border>
</Border>
            
    </Grid>
相关推荐
武藤一雄13 小时前
WPF处理耗时操作的7种方法
microsoft·c#·.net·wpf
Venom8414 小时前
我的 WPF Powermill 工具
wpf
一念春风2 天前
证件照制作工具(WPF C#)
c#·wpf
He BianGu3 天前
【笔记】在WPF中GiveFeedbackEventHandler的功能和应用场景详细介绍
笔记·wpf
就是有点傻3 天前
WPF自定义控件-水晶球
wpf
He BianGu3 天前
【笔记】在WPF中QueryContinueDragEvent的详细介绍
笔记·wpf
He BianGu3 天前
【笔记】在WPF中QueryCursor事件的功能和应用场景详细介绍
笔记·wpf
He BianGu3 天前
【笔记】在WPF中CommandManager的功能和应用场景详细介绍
笔记·wpf
关关长语3 天前
HandyControl中Button图标展示多色路径
c#·.net·wpf·handycontrol
baivfhpwxf20234 天前
WPF DataGrid 指定列的数据可以编辑功能开发
wpf