UI】Path 测量 PathMeasure ③ ( 使用 PathMeasure 绘制沿曲线运动的小球 ) 博客中 ,使用 PathMeasure 完成了一个沿曲线运动的小球,但是如果绘制的是矩形,就需要使用...这两个数组 , 适用于接收返回值的 , 并不是用于参数传递 ;
只有曲线找切线才有意义 , 直线的切线直接就是 ( 0, 0 ) 坐标 ;
下图中 , 蓝色是 圆形 的曲线 , 红色点 是 曲线上的点...:
// 在该特定点绘制圆形
canvas.drawBitmap(mBitmap, matrix, mPaint);
二、代码示例
----
package kim.hsl.paintgradient.pathmeasure...Path
Path path = new Path();
// 绘制圆形
path.addCircle(0, 0, 300, Path.Direction.CW...matrix.postTranslate(pos[0] - mBitmap.getWidth() / 2, pos[1] - mBitmap.getHeight() / 2);
// 在该特定点绘制圆形