如何呈现在路径上的文字? [英] How to render text on path?

查看:109
本文介绍了如何呈现在路径上的文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  如何写曲文?

我要呈现的文本在给定的图像(到位AMEX 3)。请告诉我如何做到这一点。

I want to render text as in given image (in place of "AMEX 3"). Please tell me how to achieve this.

推荐答案

创建了一轮路径 - 对象,然后在自定义画布使用<一href="http://developer.android.com/reference/android/graphics/Canvas.html#drawTextOnPath%28java.lang.String,%20android.graphics.Path,%20float,%20float,%20android.graphics.Paint%29">drawTextOnPath.

Create a round Path - object, and then in a custom canvas use drawTextOnPath.

Path path = new Path();
path.addCircle(x, y, radius, Path.Direction.CW);
myCanvas.drawTextOnPath(myText, path, offset, 0, myPaint);

myCanvas现在应该包含弧形文本。

myCanvas should now contain the curved text.

这篇关于如何呈现在路径上的文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆