BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-27-2010, 10:47 AM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Model: Bold
PIN: N/A
Carrier: WIFI
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Control orientation of drawing text

Please Login to Remove!

Hiberry
i have a question about the orientation of drawing text in blackberry,
is there a methode to draw a text from right to left?
i tried with this :

g.drawText("draw me from R to L", 100,100,Graphics.TOP|Graphics.RIGHT);
g.drawText("draw me from R to L", 100,100,Graphics.TOP|Graphics.LEFT);

but the result is always from left to right

please help
Offline  
Old 03-27-2010, 01:17 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Right - this is expected. What you are doing there is setting the drawing anchor point.

I'm not sure what you are trying to accomplish. Are you trying to actually draw the text backwards, or mirrored?

How about just reversing the characters in the string?
Offline  
Old 03-27-2010, 01:39 PM   #3 (permalink)
New Member
 
Join Date: Mar 2010
Model: Bold
PIN: N/A
Carrier: WIFI
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for reply
what i want to do is to force the orientation of the drawing to be from right to left so if i give x = 200 i want to have my text in the left side of this coordonate
i hope u r understinding me here
Offline  
Old 03-27-2010, 04:19 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You mean you want the text right-justified, rather than right-justified?

|Left justified_______|
|______Right justified|
Offline  
Old 03-28-2010, 06:32 AM   #5 (permalink)
New Member
 
Join Date: Mar 2010
Model: Bold
PIN: N/A
Carrier: WIFI
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes this is what i want
how to do it ?
Offline  
Old 03-28-2010, 10:43 AM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

That depends on the situation.

If you are trying to right-justify text within a text field of a certain extent, then I think you were on the right track. The extent of the field must be set larger that the text in order for you to notice the difference between the left /right anchor points.

Example:

If you don't set the extent:

|draw me from l to r|
|draw me from r to l|

You will not see the difference, right?


|draw me from l to r_______|
|_______draw me from r to l|
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.