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>
相关推荐
samble1 天前
从零搭建半导体设备上位机(九):拖拽与交互,Adorner、DragDrop 与晶圆拖放信息
wpf·拖拽·adorner
郝学胜-神的一滴3 天前
AI 编程智能体 27:吃透MCP通信机制
人工智能·python·langchain·wpf·numpy·scikit-learn
波力海苔夹心脆6754 天前
C# WPF 资源字典详解:ResourceDictionary、MergedDictionaries 与自定义控件案例
开发语言·c#·wpf·入门教程·resource·资源字典
陈仓主教4 天前
# WPF CheckBox 控件详解与使用—WPF 中的控件(6)--复选框控件(CheckBox)
wpf
光泽雨6 天前
WPF 音视频四大核心方案对比
wpf·音视频
浪扼飞舟6 天前
WPF(数据绑定)
wpf
samble7 天前
从零搭建半导体设备上位机(四):单实例、启动流程与配置文件,App 里那 526 行到底在干什么
wpf·配置文件·单实例
浪扼飞舟8 天前
WPF(控件的继承树、内容控件、布局控件)
wpf
avi911111 天前
电影开源Jevdo - 源码介绍(vue版)没有android 和 没有wpf
android·wpf·框架·数据爬虫·meego·电影管理
吾与谁归in12 天前
C#脚本工具,支持智能提示自动补全(WPF + Roslyn + AvalonEdit)
开发语言·c#·wpf