从android.graphics.Path中取出Point点,Kotlin
/*** 从一条Path中获取多少个Point点*/private fun getPoints(path: Path, pointCount: Int): Array<FloatPoint?> {val points = arrayOfNulls<FloatPoint>(pointCount)val pm = PathMeasure(path, false)val length = pm.lengthvar distance = 0fval speed = length / pointCountvar counter = 0val aCoordinates = FloatArray(2)while (distance < length && counter < pointCount) {// 从path中取出点Pointpm.getPosTan(distance, aCoordinates, null)points[counter] = FloatPoint(aCoordinates[0],aCoordinates[1])counter++distance += speed}return points}class FloatPoint(var x: Float, var y: Float)
Android图形图像处理:添加涂鸦文字_android 在图片上涂鸦-CSDN博客文章浏览阅读2k次。先看运行效果: 关键的PaintView:package com.zhangphil;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graph..._android 在图片上涂鸦https://blog.csdn.net/zhangphil/article/details/87810653