×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    How to rotate the image?

    Hi all,

    In j2me there is any possibility for rotating the image?
    Last edited by dineshk; 2008-05-19 at 06:25.

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: How to rotate the image?

    afaik the standard API's dont support it, u'll need to do a per-pixel transformation...

  3. #3
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    284

    Re: How to rotate the image?

    You can rotate by 90, 180 or 270 degrees.
    You use Image.createImage(image, ..., transform) to create a copy and set the transform parameter.

    One some phones, you can use the svg api (jsr226).
    but I don't know much about it.

    Regards

    Karsten Meier

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by internetlabor View Post
    You can rotate by 90, 180 or 270 degrees.
    You use Image.createImage(image, ..., transform) to create a copy and set the transform parameter.

    One some phones, you can use the svg api (jsr226).
    but I don't know much about it.

    Regards

    Karsten Meier
    Can u please explain in detail....

  5. #5
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    284

    Re: How to rotate the image?

    Hello dineskh,

    what should I explain?
    Also, do you want to rotate in multiples 90 degrees,
    or something in between.

    Regards

    Karsten Meier

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to rotate the image?

    This Wiki article could help (if you're using MIDP1.0):

    http://wiki.forum.nokia.com/index.ph..._image_in_J2ME

    Pit

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by jappit View Post
    This Wiki article could help (if you're using MIDP1.0):

    http://wiki.forum.nokia.com/index.ph..._image_in_J2ME

    Pit
    But iam using MIDP2.0

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to rotate the image?

    Then you can easily do (for example to rotate by 90° your image):
    Code:
    Image rotated_image = Image.createImage(original_image, 0, 0, original.getWidth(), original.getHeight(), Sprite.TRANS_ROT90);
    Pit

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by jappit View Post
    Then you can easily do (for example to rotate by 90° your image):
    Code:
    Image rotated_image = Image.createImage(original_image, 0, 0, original.getWidth(), original.getHeight(), Sprite.TRANS_ROT90);
    Pit
    Hi,

    How to initiate Sprite?

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to rotate the image?

    Hi Dineshk,

    you do not need to instantiate any Sprites if you only need to rotate an Image.

    Pit

  11. #11
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by jappit View Post
    Hi Dineshk,

    you do not need to instantiate any Sprites if you only need to rotate an Image.

    Pit
    But while compiling "cannot find the symbol Sprite" will occurs

  12. #12
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to rotate the image?

    You should import "javax.microedition.lcdui.game.Sprite".

    Pit

  13. #13
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by jappit View Post
    You should import "javax.microedition.lcdui.game.Sprite".

    Pit
    Hi,

    Image position doesn't change. It remains in the same position.

  14. #14
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: How to rotate the image?

    Quote Originally Posted by dineshk View Post
    Hi,

    Image position doesn't change. It remains in the same position.
    Hi jappit,

    I can solve it. Now it works fine..
    Thanks a lot

Similar Threads

  1. --- ???save image problem??? ---
    By ferenn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-10-01, 14:33
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×