剪切具有CornerRadius的RectangleGeometry(可能在Ripple中用到)
剪切具有CornerRadius的RectangleGeometry(可能在Ripple中用到)
1、新建Converter
public class BorderClipConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == && values[] is double && values[] is double && values[] is CornerRadius)
{
var width = (double)values[];
var height = (double)values[]; if (width < Double.Epsilon || height < Double.Epsilon)
{
return Geometry.Empty;
} var radius = (CornerRadius)values[]; var clip = new System.Windows.Media.RectangleGeometry(new Rect(0, 0, width, height), radius.TopLeft, radius.TopLeft);
clip.Freeze(); return clip;
} return DependencyProperty.UnsetValue;
} public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
2、添加Converter
<controls:Ripple.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" ElementName="border" />
<Binding Path="ActualHeight" ElementName="border" />
<Binding Path="CornerRadius" ElementName="border" />
</MultiBinding>
</controls:Ripple.Clip>
剪切具有CornerRadius的RectangleGeometry(可能在Ripple中用到)的更多相关文章
- UWP 图片剪切旋转工具
好久没撸随笔了,明天终于放假休息了..准备去进行信仰充值,看<魔兽>去(话说surface phone 好久出,让我这个做UWP的也充点信仰..) 先上下效果图: 在设计中,遇到一个问题, ...
- iOS | Swift图片剪切圆角
我们在IOS开发中,时常需要将一些原本是方形的图片剪切成圆形或者边框是曲线的样子,表现得活泼生动一些. 注意:因为最近在尝试用Swiftl开发,所以这里的语言使用的就是Swift,OC的语法也是相近的 ...
- Bing Maps进阶系列六:使用Silverlight剪切(Clip)特性实现Bing Maps的迷你小地图
Bing Maps进阶系列六:使用Silverlight剪切(Clip)特性实现Bing Maps的迷你小地图 Bing Maps Silverlight Control虽然为我们提供了简洁.方面的开 ...
- 用ffmpeg快速剪切和合并视频
如果直接找视频剪切和合并视频的软件,通常出来的都是大的视频编辑软件或者是有图形界面的剪切软件,大型一点的功能太多安装麻烦,小型一点的功能可能不齐全. 只是简单的剪切或者一下合并一下,还是ffmpeg这 ...
- C#剪切,复制,粘贴底层应用编写
zz备用复制剪切粘贴的底层应用 /// <summary> /// 复制或剪切文件至剪贴板(方法) /// </summary> /// <param name=&quo ...
- css text-overflow:ellipsis 文字多余剪切
text-overflow: ellipsis;多度剪切white-space: nowrap;禁止换行overflow: hidden;多余隐藏
- js禁用右键菜单、选中、复制、剪切、粘贴
//屏蔽右键菜单 document.oncontextmenu = function (event) { if (window.event) { event = window.event; } try ...
- RichTextBox实现鼠标右键(剪切,复制,粘贴)功能
private static void InitRichTextBoxContextMenu(RichTextBox textBox) { //创建剪切子菜单 var cutMenuItem = ne ...
- iOS视图弹出、平移、旋转、翻转、剪切等变换效果实现
效果图: 1.定义属性 @property (nonatomic, strong) UIView *transformView;//发生变换的试图 @property (nonatomic, stro ...
随机推荐
- 【DataStructure】The difference among methods addAll(),retainAll() and removeAll()
In the Java collection framework, there are three similar methods, addAll(),retainAll() and removeAl ...
- How do I UPDATE from a SELECT in SQL Server?
方法1 https://stackoverflow.com/questions/2334712/how-do-i-update-from-a-select-in-sql-server UPDATE T ...
- [MySQL] 按年度、季度、月度、周、日统计查询
该死的mysql没有提供unix时间戳的专门处理函数,所以,如果遇到时间分组,而你用的又是整型unix时间戳,则只有转化为mysql的其他日期类型! FROM_UNIXTIM()将unix时间戳转 ...
- centos + nodejs + egg2.x 开发微信分享功能
本文章发到掘金上,请移步阅读: https://juejin.im/post/5cf10b02e51d45778f076ccd
- POJ 2771 最大独立集 匈牙利算法
(为什么最大独立集的背景都是严打搞对象的( _ _)ノ|壁) 思路:匈牙利算法 没什么可说的-- // by SiriusRen #include <cstdio> #include &l ...
- 转:Eclipse上安装GIT插件EGit及使用
一.Eclipse上安装GIT插件EGit Eclipse的版本eclipse-java-helios-SR2-win32.zip(在Eclipse3.3版本找不到对应的 EGit插件,无法安装) E ...
- webpack配置的学习
1.把不需要打包的文件复制到打包后的文件夹里 2.通过 Plugin 把注入到 bundle.js 文件里的 CSS 提取到单独的文件中
- 查看md文件
使用命令将md文件转为html,在浏览器中演示 通过npm安装i5ting_toc 安装好node之后,可以直接使用npm.Windows+R打开运行框,输入cmd,打开命令窗口.连网的情况下,输入如 ...
- table标签 在谷歌和ie浏览器下不同的表现效果
在项目中有了一个这样的需求: 我需要利用vue的模板语法v-for循环生成tr,这个tr是需要双重循环来确定其个数的, 我的实现: 我在tr外面包了一个template标签, 效果: 谷歌浏览器下实现 ...
- 使用CablleStatement调用存储过程
/** * 使用CablleStatement调用存储过程 * @author APPle * */ public class Demo1 { /** * 调用带有输入参数的存储过程 * CALL p ...