Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2006

    Question to know an image is PNG32 or PNG8

    is there any way to know an image is png32 or png8 in runtime state ?

    because, I need to know which image use how much heap when it s loaded.

    I can compute it with image.width x image.height. but, I need to know 32 or 8 bit depth to know exact heap size.

  2. #2
    Registered User
    Join Date
    Sep 2007

    Re: to know an image is PNG32 or PNG8

    Hi adem666,

    Please refer the javax.microedition.lcdui.Graphics APIods toc . First create the image object from the image object get the graphics and try some of these meth to compute color depth getBlueComponent() , getReadComponent() , getGreenComponent() , getGrayScale() methods . May be these methods helps you .

    Depth of the image will be calculated like = r*g*b

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK

    Re: to know an image is PNG32 or PNG8

    The original format is irrelevant to the heap requirements. The number of bits per pixel will be chosen by the phone, usually to match it's display hardware (plus some implementation-dependent alpha data).


Similar Threads

  1. How to know an event is meeting or todo or anniversary?
    By sponnukumar in forum Mobile Java General
    Replies: 2
    Last Post: 2009-02-02, 12:51
  2. Replies: 6
    Last Post: 2008-04-09, 14:24
  3. Replies: 5
    Last Post: 2007-08-02, 13:22
  4. Replies: 3
    Last Post: 2003-12-04, 07:56
  5. How to know if a midlet is executed in a phone or in an emulator ?
    By ulysseo42 in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2003-11-06, 07:15

Posting Permissions

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