Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I guess the problem is one of the following reasons: </p> <p>1.Resource name:</p> <p>Resource names are case-sensitive; for example, <strong>/ellen-png.png</strong> is not the same resource as <strong>/ellen-png.PNG</strong> or any other variation. </p> <p>2.Format:</p> <p>The only format that must be supported is png. Some phones might support other formats such as: </p> <ul> <li>Graphics Interchange Format (GIF) </li> <li>Joint Photographic Experts Group (JPEG, JPG)</li> <li>Windows or OS/2 Bitmap (BMP) </li> <li>Tag Image File Format (TIF)</li> <li>PC Paintbrush bitmap (PCX)</li> <li>Raw signed PCM data (RAW) </li> </ul> <p>But that depends on the device, and if you wanna be as cross-platform as possible then just use pngs:<br> In 1999, when Sun Microsystems developed the J2ME platform specification and its supporting APIs, PNG was chosen as the default image format because of its graphics capabilities, small file size, and that it was unencumbered with patent issues.<br> To determine if J2ME handles a specific media format, you invoke the <a href="http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/media/Manager.html#getSupportedContentTypes%28java.lang.String%29" rel="nofollow">getSupportedContentTypes</a> method. This method returns a string array of supported media types, and includes the audio and video formats along with the image formats. The strings present this information in MIME-type format.For example to check for GIF support, you scan this array, looking for the GIF MIME-type string. If there is a match, then the phone's J2ME implementation supports native display of GIF files.This snippet code can use for this purpose: </p> <pre><code>private String mediaTypes[]; private final String GIF_MIME_TYPE = "image/gif"; private boolean gifSupported; // Get the media types to check for support of GIF file display mediaTypes = Manager.getSupportedContentTypes(null); int count = mediaTypes.length; // Check list for GIF MIME type; set support flag if present gifSupported = false; for (int i = 0; i &lt; count; i++) { if (mediaTypes[i] == GIF_MIME_TYPE) gifSupported = true; } // end for </code></pre> <p>If you would to use special format,you can use special decoders to decode image from not supported format.<br> createImage throws <strong>java.io.IOException</strong> if the resource does not exist(specially incorrect resource name), the data cannot be loaded, or the image data cannot be decoded.So if you catch this exception check every case. </p> <p>3.Size:<br> Note that the sizes of JAR files that specific devices can load depend on multiple factors, including limitations imposed by handset manufacturers and carriers, or even the available memory configuration on a specific device.Image file sizes must be in range 9.1 Kbytes for GIF to 69.5 Kbytes for TIF.Of course, since you probably want to make them as small as possible, you might want to try a tool like <a href="http://pmt.sourceforge.net/pngcrush/" rel="nofollow">pngcrush</a>, for that. Its main purpose is to reduce the size of the PNG IDAT datastream by trying various compression levels and PNG filter methods. </p> <p>References: </p> <p><a href="http://developers.sun.com/mobility/midp/questions/imagetype/" rel="nofollow">SDN FAQ - What image types does MIDP support?</a><br> <a href="http://www.gamedev.net/topic/210335-image-formats-in-j2me/" rel="nofollow">gamedev.net - Image Formats in J2ME</a><br> <a href="http://drdobbs.com/jvm/184406435" rel="nofollow">drdobbs.com - Displaying GIF Images on J2ME Mobile Phones</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload