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>
相关推荐
凌镜icecraft4 天前
我改文件扩展名的时候那个警告弹窗再也不会弹出来了
windows·c#·wpf·explorer
光泽雨9 天前
控件Password附加属性
wpf
samble13 天前
从零搭建半导体设备上位机(十二):参数设置页,表单校验、范围校验与配方联动
wpf·数据校验·validationrule
samble22 天前
从零搭建半导体设备上位机(九):拖拽与交互,Adorner、DragDrop 与晶圆拖放信息
wpf·拖拽·adorner
郝学胜-神的一滴23 天前
AI 编程智能体 27:吃透MCP通信机制
人工智能·python·langchain·wpf·numpy·scikit-learn
波力海苔夹心脆67524 天前
C# WPF 资源字典详解:ResourceDictionary、MergedDictionaries 与自定义控件案例
开发语言·c#·wpf·入门教程·resource·资源字典
陈仓主教24 天前
# WPF CheckBox 控件详解与使用—WPF 中的控件(6)--复选框控件(CheckBox)
wpf
光泽雨1 个月前
WPF 音视频四大核心方案对比
wpf·音视频
浪扼飞舟1 个月前
WPF(数据绑定)
wpf
samble1 个月前
从零搭建半导体设备上位机(四):单实例、启动流程与配置文件,App 里那 526 行到底在干什么
wpf·配置文件·单实例