首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏dino.c的专栏

    [WPF] 实现 WPF 的 Inner Shadow

    文章涉及到以下概念: UIElement.ClipToBounds 属性 (System.Windows) UIElement.Clip 属性 (System.Windows) UIElement.OpacityMask ClipToBounds <Border> <Border.Clip> <RectangleGeometry Rect="0,0,100,100" /> </Border.Clip 要做内部阴影的话就只是将外部阴影裁剪掉,在 Border 上简单地加上 ClipToBounds="True" 就可以实现这个效果: ClipToBounds 属性用于指示是否剪切此元素的内容(或来自此元素的子元素的内容

    1.3K10编辑于 2021-12-28
  • 来自专栏Dotnet9

    【荐】牛逼的WPF动画库:XamlFlair

    Using the `StartWith` Property[21] Using the `AllowOpacityReset` Property (*WPF Only*)[22] Using the `ClipToBounds Primary/Secondary Completion Commands ✔ ✔ ✔ ✔ ✔ ✔ StartWith ✔ ✔ ✔ ✔ ✔ ✔ AllowOpacityReset - ✔ - - - - ClipToBounds AllowOpacityReset Property (WPF Only): #using-the-allowopacityreset-property-wpf-only [23] Using the ClipToBounds Property (UWP And Uno Only): #using-the-cliptobounds-property-uwp-and-uno-only [24] Debugging Animations

    2.6K10发布于 2021-12-01
  • 来自专栏dino.c的专栏

    [WPF] 使用 Effect 玩玩阴影、内阴影、 长阴影

    我的做法是用一个 VisualBrush 获取需要做阴影的图像,然后再用 WPF 的 BlurEffect 让它变模糊: <Grid ClipToBounds="True"> <Grid> Opacity; return c; } 最后在应用了 BlurEffect 的元素外面再套一层 Grid,然后在这个 Grid 应用刚刚写的 FakeDrpShadowEffect: <Grid ClipToBounds TextAlignment="Center"> INNER<LineBreak /> SHADOW</TextBlock> </Grid> <Grid ClipToBounds

    2.1K20编辑于 2022-05-07
  • 来自专栏我的WPF笔记

    记一次自定义基因分类图实现(二)

    " Margin="0,0,0,0" x:Name="paramBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds Border Grid.Column="0" Grid.Row="1" Margin="0,0,0,0" x:Name="verBorder" VerticalAlignment="Stretch" ClipToBounds BorderThickness="0,0,0,0" BorderBrush="Black" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds

    21500编辑于 2025-04-26
  • 来自专栏walterlv - 吕毅的博客

    Visual->UIElement->FrameworkElement,带来更多功能的同时也带来了更多的限制

    <see cref="Clip"/> property) clip geometry /// that is used to intersect Clip in case if <see cref="<em>ClipToBounds</em> layout space given to the UIElement. /// </summary> /// <returns>Geometry to use as additional clip if <em>ClipToBounds</em> =true</returns> protected virtual Geometry GetLayoutClip(Size layoutSlotSize) { if(<em>ClipToBounds</em>) RenderSize)); rect.Freeze(); return rect; } else return null; } 只会在 <em>ClipToBounds</em>

    84130发布于 2018-09-18
  • 来自专栏码客

    Jetpack Compose中的下拉刷新

    import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clipToBounds (state.nestedScrollConnection) .fillMaxWidth() .height(200.dp) .clipToBounds

    2.4K10编辑于 2024-03-29
  • 来自专栏历史专栏

    【愚公系列】2023年10月 WPF控件专题 Canvas控件详解

    ClipToBounds:指示内容是否应该被裁剪以适应容器的大小。IsItemsHost:指示Canvas是否是一个ItemsControl的容器。 3.具体案例<Grid> <Canvas ClipToBounds="true"> <!

    1.2K00编辑于 2023-10-05
  • 来自专栏dino.c的专栏

    [WPF自定义控件库]自定义Expander

    VerticalContentAlignment}" Margin="{TemplateBinding Padding}" ClipToBounds Percentage); } 最后,因为没有使用Arrange限制子元素的大小,子元素的UI一定会超出范围,所以要overrid GetLayoutClip 函数控制当子元素超出自身大小时是否显示超出的部分,可以用ClipToBounds protected override Geometry GetLayoutClip(Size layoutSlotSize) { if (ClipToBounds) return

    1.3K20发布于 2019-07-26
  • 来自专栏独立观察员博客

    如何优雅的为 DataGrid 设置圆角

    BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" ClipToBounds TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" ClipToBounds BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" ClipToBounds

    1.1K00编辑于 2024-11-23
  • 来自专栏滕先生的博客

    CALayer 图层概念二、CALayer属性二、方法

    此处可以和UIView的clipToBounds来比较记忆(clipToBounds为yes会使其上的内容包括子视图不能超出边界) 控件截图裁剪的三种方法: 给layer设置圆角半径layer.cornerRadius view的clipToBounds 裁剪多余边缘 设置photoView中的所有子控件如果超出了photoView的有效范围,那么超出的部分将不会显示 photoView.clipsToBounds

    2.1K70发布于 2018-05-18
  • 来自专栏码客

    WPF图片(Image)或布局的缩放和旋转(TransformGroup与Transform)

    布局 <Grid Name="OuterGrid" ClipToBounds="True"> <Grid x:Name="MGridImage"

    1.2K10编辑于 2024-06-01
  • 来自专栏iOS开发~

    Compose_Modifier 修饰符的常见使用

    / 绝对偏移,不考虑布局方向 3.样式 Modifier .alpha(0.5f) // 不透明度 .clip(shape = RoundedCornerShape(8.dp)) // 圆角 .clipToBounds

    41110编辑于 2024-07-21
  • 来自专栏walterlv - 吕毅的博客

    WPF 制作高性能的透明背景异形窗口(使用 WindowChrome 而不要使用 AllowsTransparency=True)

    BlurRadius="64" /> </Border.Effect> <ContentPresenter ClipToBounds BlurRadius="64" /> </Border.Effect> <ContentPresenter ClipToBounds

    2.9K20编辑于 2023-10-22
  • 来自专栏林德熙的博客

    WPF 自定义控件入门 可重写的各个方法或属性的意义

    对于继承 UIElement 元素的控件来说,取决于 ClipToBounds 属性,默认此 ClipToBounds 属性是 false 值,意味着不会自动裁剪,如果设置 true 的值,将会返回裁剪大小为 忽略其他代码 protected virtual Geometry GetLayoutClip(Size layoutSlotSize) { if(ClipToBounds

    2K20编辑于 2023-04-07
  • 来自专栏林德熙的博客

    WPF 某个界面或控件在界面找不到看不到可能的原因

    自然第二层控件就看不见 被裁剪 控件所在的容器,如果设置了 Clip 属性或者 ClipToBounds 等属性,容器可以裁剪元素。

    2.8K10编辑于 2021-12-24
  • 来自专栏QQ音乐技术团队的专栏

    从源码出发浅析 Android TV 的焦点移动原理(下篇)

    offsetRectBetweenParentAndChild(View descendant, Rect rect, boolean offsetFromChildToParent, boolean clipToBounds

    3.9K10发布于 2017-11-06
  • 来自专栏czwy的博客

    WPF实现Element UI风格的日期时间选择器

    {TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" ClipToBounds

    2.4K50编辑于 2023-10-22
  • 来自专栏葡萄城控件技术团队

    WPF/Silverlight Layout 系统概述——Arrange

    MyPanel.Arrange传入参数finalRect,Mypanel.MinWidth,Width,MaxWidth,Margin,DesiredSize,HorizoantalUseLayoutRounding,ClipToBounds

    1K90发布于 2018-01-10
  • 来自专栏CSharp编程大全

    WPF快速入门系列(1)——WPF布局概览

    Canvas默认不会自动裁剪超过自身范围的内容,即溢出的内容会显示在Canvas外面,这是因为Canvas的ClipToBounds属性默认值是false,我们可以显式地设置为true来裁剪多出的内容。

    4.2K20发布于 2020-11-10
领券