java image

R

rathees_h

How can i rotate a java image without using Graphics2D &
AffineTransform ? .Actually i want to implement this in j2me.
 
R

Roedy Green

How can i rotate a java image without using Graphics2D &
AffineTransform ? .Actually i want to implement this in j2me

if it is a small enough image, you can grab it pixel by pixel, and
plop it into a new Image array pixel by pixel where it belongs.
 
O

Oliver Wong

Roedy Green said:
if it is a small enough image, you can grab it pixel by pixel, and
plop it into a new Image array pixel by pixel where it belongs.

The other method is to start from the target image, and then "work
backwards" and determine which pixel to "plop" from in the source image. You
might do "nearest-neighbour" approximation, where the same pixel from the
source might be used for two or more pixels in the target, or some sort of
weighed-average of the neighbouring pixels in the source image depending on
what your sin/cosine functions return as the source coordinates.

Depends on how much processing power you have available to you, and how
patient your users are.

- Oliver
 
R

Roedy Green

How can i rotate a java image without using Graphics2D &
AffineTransform ? .Actually i want to implement this in j2me.

If all you want is a rotating icon, prerotate icon and keep around png
files of the icon at different degrees of rotation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top