这就是我想要画的。它有
答案 0 :(得分:1)
以编程方式,这就是我最终实现目标的方式:
Path path = new Path();
path.moveTo(coord0X, coord0Y);
path.lineTo(coord1X, coord1Y);
path.lineTo(coord2X, coord2Y);
path.lineTo(coord3X, coord3Y);
path.lineTo(coord0X, coord0Y);
ShapeDrawable shapeDrawable = new ShapeDrawable(new PathShape(path, dx, dy));
shapeDrawable.setBounds(x, y, x+dx, y+dy);
shapeDrawable.getPaint().setStyle(Paint.Style.FILL);
Shader fillShader = new BitmapShader(myTextureBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
shapeDrawable.getPaint().setShader(fillShader);
我现在用纹理BMP绘制平行四边形。
添加颜色过滤器: