• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 833
  • Last Modified:

AffineTransform in J2ME

Hi guys,

Is it possible for J2ME applications to perform AffineTransforms? I am looking for methods that deal with rotation (free rotation, meaning any degree can be specified) and transparency. But apparently, there is nothing in the API specifications.

Is there any free third-party graphics library that I can download in order to perform such operations? Or can I write it myself easily? I am currently working on my final year project, so I do not have any budget to purchase anything.

Thanks in advance for any help.
0
dr0zaxx
Asked:
dr0zaxx
  • 5
  • 3
1 Solution
 
dr0zaxxAuthor Commented:
I apologise for not phrasing my question properly. I am trying to perform affinetransforms when drawing shapes using the Graphics class. I cannot use the Sprite class because I have no images. Also, it only allows rotation of multiples of 90 degrees.
0
 
TimYatesCommented:
No then, there isn't anything :-(

You'll have to rotate your points for your shapes yourself, and for transparency, I'd have a look at the API for the phone you are developing for...  There should be something in there...

That is, unless anyone else knows of a proper way of doing this?

Have you posted a link question for 20 points in http://www.experts-exchange.com/Programming/Wireless_Programming/ with the URL of this question in it?

Someone over there might be able to help?

Tim
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dr0zaxxAuthor Commented:
Write my own rotation? Sounds impossible, since J2ME does not support trigonometry.
0
 
TimYatesCommented:
http://home.rochester.rr.com/ohommes/MathFP/

is a J2ME floating point math library...
0
 
jimmackCommented:
That's a fixed point library ;-), but it's probably about the best you'll get.  You may find that it's easier to provide some lookup tables for the trig functions for specific angles rather than to try to handle completely free rotation.

Just a thought.
0
 
dr0zaxxAuthor Commented:
Ok basically I have found the fixed point library very useful. Now how do I go about using this class to perform rotation (I guess trigonometry is needed)? My mathematics is pretty bad, so pardon me. :)
0
 
TimYatesCommented:
Can you post some of your code?

The bit that does the drawing?

Tim
0
 
TimYatesCommented:
I think I deserve the points, as " No then, there isn't anything :-(" is a valid answer..
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now