×

Discussion Board

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

    internal representation of images

    When I create an Image object from resource (a png file), does it internally convert it to a raw format (24-bit or device dependent format e.g. 555RGB) ? or does it convert it on the fly when drawing it ?

    If it statically converts it to 24-bit raw format:
    1) I can store the raw image on the resource since it is already being compressed by jar.
    2) Draw it using drawRGB.
    so there is no need to use png if I had custom palettized and raw image processing routines.

    If it dynamically converts it to raw format, what is the performance consequences of this ? It must look up palette tables and convert it to device dependent format, that must be a little heavy process.

    Thanks in advance.

    MB

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    There is no "iron rule" on this but most phones will convert it to their native pixel format for speedier drawing. All Nokia phones do this. It is easy to find out if a phone does this by using the freeMemory() method in Runtime and seeing how much memory is used when you load a png (since a raw format will take up much more heap space).

    shmoove

Posting Permissions

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