×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    2

    What can be the solution

    in nokia we have following method to draw the pixel array of short , which doesnt exist in MIDP api.

    drawPixels(short[] pixels, boolean transparancy,int offset,int x, int y, int width,int height, int manipulation,int format);

    if pixel array contains values of color to draw on the screen.

    how it is possible in MIDP to render the same image with no color difference compare to nokia api.

    there is drawRGB method in midp which plots the integer array.

    How it is possible to convert the short pixel array (containing the color value) into an integer pixel array for MIDP without changing color effect.

    please suggest me how it can be done?

    i tried it to convert a short pixel array into an integer but i am not getting the same color effect as that of getting in nokia.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Remember that the drawRGB() method appears only in MIDP2.0, not MIDP1.0.

    The colour values are not numerically equivalent. The integer values for MIDP2.0 have 8 bits for each Alpha, Red, Green and Blue. The short values you have for the Nokia API are four bits for each channel (assuming they are formatted "4444").

    For example, you have a colour for the Nokia with the value 0xF8A0 - these are Alpha (F), Red (8), Green (A) and Blue (0), so this is a fully opaque greenish-yellow. To show the same colour through the MIDP2.0 API, this needs to become 0xFF88AA00 (FF Alpha, 88 Red, AA Green, 00 Blue).

    I'll leave the remapping algorithm to you!

    Cheers,
    Graham.

Posting Permissions

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