效果
步骤分解
像太极图这种比较规则的图形,一般就是用数学知识进行图形分解,分成一个个基本图形,比如线段,圆,矩形,扇形,多边形等,然后一步步绘制出来即可。
- 分解太极图
@Override
protected void onDraw(Canvas canvas) {
int width = getWidth();
int height = getHeight();
//平移画布到View的中间
canvas.translate(width / 2, height / 2);
//底色
canvas.drawCol