android - 在 Android canvas 中绘制 2D 曲线?

标签 android 2d android-canvas curve

我们如何在 Canvas 中绘制这样的二维曲线?

enter image description here enter image description here enter image description here

所有类似的曲线都有数学公式或者是分形,但是 Canvas 只有一些绘制简单形状(如三角形或矩形)的方法。我知道大多数曲线可以分成更简单的形状,例如绘制 Heart Curve , 但有没有更简单的方法来使用 Canvas 绘制二维曲线?

最佳答案

使用 Path 对象,您可以在 Canvas 中做一些更漂亮的线条和曲线。只是随机发现了这两个问题;我希望他们能为您指明正确的方向,因为我个人没有使用过它们。

Draw a perfect curve connecting three points

Bezier curve and canvas

关于android - 在 Android canvas 中绘制 2D 曲线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13980974/

相关文章:

java - android 在设备上保存非常小的数据的最佳方法

android - Google Play 游戏服务能否在内部测试轨道上进行测试?

android - libgdx Viewports - 为什么当我使用 FitViewport 时触摸输入 x 和 y 不准确?

android - Drawable 不是在 Canvas 上绘制

android - 如何在 RecycleViewer 中更改 Canvas?

android - 使用内容提供程序时重新创建数据库

android - SeekBar 正在崩溃 Nullpointer 异常。

c++ - 为什么不能在 2D vector 中 push_back? C++

performance - 快速找到图像中最接近的非黑色像素

java - Mychart 确实显示了 android 中的任何内容