当然可以.您需要先缩放画布.试试这个:
paint.setTextSize(44);
int cx = this.getMeasuredWidth() / 2;
int cy = this.getMeasuredHeight() / 2;
paint.setColor(Color.RED);
canvas.drawText("Hello", cx, cy, paint);
canvas.save();
canvas.scale(1f, -0.5f, cx, cy);
paint.setColor(Color.GRAY);
canvas.drawText("Hello", cx, cy, paint);
super.onDraw(canvas);
canvas.restore();
Run Code Online (Sandbox Code Playgroud)
尝试使用不同的刻度Y值来获得所需的效果.

| 归档时间: |
|
| 查看次数: |
2465 次 |
| 最近记录: |