绘画不能在canvas.drawVertices上工作?

时间:2019-04-04 13:05:22

标签: java android canvas draw vertices

我的drawVertices(...)涂有如下涂料

   val paint = Paint().apply {
        style = Paint.Style.STROKE
        strokeCap = Paint.Cap.ROUND
        strokeJoin = Paint.Join.ROUND
        isAntiAlias = true
        textAlign = Paint.Align.CENTER
        textSize = resources.dpToPx(30)
        color = Color.RED
        strokeWidth = resources.dpToPx(8)
    }

    val verts = floatArrayOf(0f, 0f, width.toFloat(), 0f, width/2f, height/2f,
        width/2f, height/2f, 0f, height.toFloat(), width.toFloat(), height.toFloat())

    canvas.drawVertices(
        Canvas.VertexMode.TRIANGLES,
        verts.size, verts, 0,
        null, 0,
        null, 0,
        indices, 0, indices.size,
        paint
    )

但是绘制的顶点仍然是彩色的,并且看似带有线条的1px。因此,无论我将paint更改为什么(例如Color.RED

paint中没有真正使用drawVertices吗? (我尝试放入null,它无法编译)

0 个答案:

没有答案