Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render text on path? [duplicate]

Tags:

android

Possible Duplicate:
How to write curved text?

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

Image with the text "AMEX 3" inside a curved arrow

like image 473
Monali Avatar asked Dec 16 '22 06:12

Monali


1 Answers

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 should now contain the curved text.

like image 66
Jave Avatar answered Jan 13 '23 18:01

Jave