Skip to main content

Painter Rotate

2 replies [Last post]
dorzeidman
Offline
Joined: 2011-06-30
Points: 0

Hello,

I want to write a string in 90 degree angle but i get an error "Affine unsupported"

Anyone got any idea why it wont work;

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07
Points: 0

MIDP doesn't support affine transform although other ports do (e.g. the SE port and some others), hence no rotation etc.

To rotate text draw it on a square mutable image and rotate the image 90 degrees, you would probably need to draw the background color etc. too since MIDP's mutable images don't support transparency either (unless you use the modifyAlpha feature we provide which has some issues).

benefiz
Offline
Joined: 2008-10-29
Points: 0

Hey

see LWUITImplementation.java. It is not implemented (only for images). In case you are using the LWUIT MIDP port it is not implemented there either (again only for images).

AFAIK if you want to rotate text in MIDP it gets tricky. The Graphic class there doesn't support that. In LWUIT you need would need to override the paint method of your TextArea/Field to call a custom drawTextArea which makes then usage of the following trick

http://www.developer.nokia.com/Community/Wiki/How_to_display_rotated_text_in_Java_ME

Looking forward to other suggestions.

Ben