How to know the length of the character using Graphics?

Put your problem here if it does not fit any of the other categories.

How to know the length of the character using Graphics?

Postby manojkumar » Fri Aug 21, 2009 3:26 pm

Hi friends,
How can I know the length of the each character of word.
Actually, I am trying some thing like this:
I will show some set of lines on the screen. Later after some time, I
would like to set the color to each character in the line at a
frequent interval.
Here I am drawing the txt on canvas c:
p = new paint();
p.setAlpha(0x30);
p.setXfermode(new PorterDuffXfermode
(PorterDuff.Mode.SRC));
p.setTextSize(20);
p.setTextAlign(Paint.Align.LEFT);
c.drawText("some data",x,y,p);
here c and p are Canvas and Paint respectively.
Now I want to set the color to each and every character of the drawn
string.
How can I achieve this.
Please help me.
Thanks,
Manoj.
Manoj
manojkumar
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Apr 02, 2009 4:27 pm

Top

Postby mad.dogg » Fri Aug 21, 2009 4:12 pm

Look here
You have an API for all the things you wanna do.
If it's boring it ain't heavy enough!
mad.dogg
Developer
Developer
 
Posts: 42
Joined: Tue May 20, 2008 2:18 pm
Location: Bulgaria

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 18 guests