Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一个遥控器,但不确定如何使用如下图所示的弧线绘制路径。
我考虑使用 SKPath.DrawArc 来绘制该按钮。当用户点击屏幕时,我可以比较触摸点在 SKPath 内。目前,我不知道如何使用 SKPath 来绘制照片中的弧线。
我希望创建一个包含对 SkiaSharp 有用的位的附加库。尚未发布任何内容,但绘制这些形状/弧线/扇区是开发中的功能之一。
这是我将创建弧的代码: https ://github.com/mono/SkiaSharp/blob/322baee72a018a889e85fc48b42cde9764797dae/source/SkiaSharp.Extended/SkiaSharp.Extended.Shared/SKGeometry.cs#L19-L79
你会像这样使用它:
SKPath path = SKGeometry.CreateSectorPath(0.625f, 0.875f, 100f, 50f);
此代码在 NuGet 中尚不可用,我认为在不久的将来也不会。但是,您可以继续并将其添加到您的应用程序中。