看啥推荐读物
专栏名称: dotNET跨平台
专注于.NET Core的技术传播。在这里你可以谈微软.NET,Mono的跨平台开发技术。在这里可以让你的.NET项目有新的思路,不局限于微软的技术栈,横跨Windows,Linux 主流平台
今天看啥  ›  专栏  ›  dotNET跨平台

WPF效果第二百篇之再玩Gamma曲线

dotNET跨平台  · 公众号  ·  · 2022-09-30 07:47
前面效果中使用比较low的方式实现了2.4的Gamma曲线;虽说后面加了点动画呈现效果,但也就是个过渡版;今天才基本符合需求的效果:1、还是基于WPF效果第一百七十八篇之贝塞尔曲线他来实现的:3个ListBox3个LandmarkControl2、在LandmarkControl增加插点位事件View:LandmarkControl Points="{Binding Points}" x:Name="RedLandMark" PathColor="Red" MouseLeftButtonDown="LandmarkControl_MouseLeftButtonDown"/>3、中间点的Insert:PointViewModel newPointModel = new PointViewModel((float) newPoint.X, (float) newPoint.Y);var pointsList = points.Select(it => new Rulyotano.Math.Geometry.Point(it.X, it.Y));var insertIndex = Helpers.BestPlaceToInsert(newPoint, pointsList.ToList());points.Insert(insertIndex, newPointModel);4、最后就是限制在框内拖拽显示:PathGeometry g = myPathGeometry.GetOutlinedPathGeometry(); //进行处理修改点位 foreach(var f in g.Figures) { foreach(var s in f.Segments) {} }最终简单的效果 ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照