×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    35

    rotating a image

    is there any helper function in MIDP which can be used to rotate the image or any way to make the user feel as if image is rotataing....i can move the image up/down or left/right using coordinate translation but cant rotate .......any ideas

    manik

  2. #2
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Not in MIDP 1.0. You can rotate image in MIDP 2.0

    Well, there is one way for MIDP 1.0...
    Have a look at http://kobjects.org/utils4me/ There's a code for image scaling. You can rotate image using similar way.

    Basically it means calculating new position of the every rotated pixel, then setClipping single pixel and drawImage oldImage onto new one so, that oldPixel will be placed into the newPixel position.
    For me it looks quite weird and slow, but it will work

    Well, there is one more way of the comparable or even bigger difficulty. If you know PNG file format you can load source image bytes and modify byte array.

  3. #3
    Regular Contributor
    Join Date
    Aug 2003
    Location
    uk
    Posts
    232

    manually loading a png and rotating the bytes

    This is not as hard as it might sound for one simple reason.

    If you are manually loading it, then there is no reason to stick the png format, you can choose any format you want.

    The format of bmp files is for example very simple, and well documented.

    Alex

  4. #4
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    alex_crowther
    If you are manually loading it, then there is no reason to stick the png format, you can choose any format you want

    This will work, but for Nokia phones only, you'll have to use Nokia's DirectUtils for it.

    If you want a general solution, you'll have to eventually convert picture data into PNG format

Posting Permissions

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