-1

我需要使用画布在字母 A 内的空白处绘制颜色。我怎样才能做到这一点?在此处输入图像描述

4

1 回答 1

2

绘制多边形时使用油漆颜色。例子:

    Paint red = new Paint();
    red.setColor(android.graphics.Color.RED);
    red.setStyle(Paint.Style.FILL);

    Path path = new Path();
    path.moveTo(point1.x, point1.y);
    path.lineTo(point2.x, point2.y);
    path.moveTo(point2.x, point2.y);
    path.lineTo(point3.x, point3.y);
    path.moveTo(point3.x, point3.y);
    path.lineTo(point1.x, point1.y);
    path.close();

    canvas.drawPath(path, red);
于 2013-05-07T02:26:33.337 回答