×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    1

    having trouble loading pictures

    sun mobile editon 5
    midp 2.0 cldc 1.0
    problem
    i am having trouble in loading pictures, when im using the emulator for the ide
    sun mobile edition 5 the pictures loads, but when i run the compiled
    .jar in the wireless toolkit 2.1 pictures the pictures cannot be a loaded using the method
    Image.createImage(). pls help.. need very bady.. 3 nights no sleep..

  2. #2
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605
    Have u saved the pic with proper path in the JAR file ...?

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    4
    When I load images I use this line of code:

    img_menu = Image.createImage( "/menu.png" );

    There's no need to include the res/ directory in the path name. Don't know why but it works for me.

    Hope this might help.

  4. #4
    Regular Contributor
    Join Date
    Aug 2003
    Location
    uk
    Posts
    232
    In order to find out where the pictures have been stored in the jar file type the following:

    jar -tf <your_jar_file>

    You should see something like

    META-INF/
    META-INF/MANIFEST.MF
    app_icon.png
    GameMIDlet.class

    "/app_icon.png" should work

    "app_icon.png" should also work.

    Note: most phones only support pngs, so trying to load a jpg for example will fail.

Posting Permissions

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