×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    7

    Question 3DMobile image loading give IOexception

    Hello,

    I'm using the Asha 501 SDK with CLDC 1.1 and MIDP 2.1 and running this Midlet code:

    http://www.informit.com/articles/art...79941&seqNum=2

    I'm trying to load a spinning textured cube in the emulator.

    It compiles fine but when it runs, I get the first IOException from the Image.createImage() method (I assume that's what it's flagging up, -I'm from C++ land, so I'm trying to figure this out as I go).

    java.io.IOException
    - javax.microedition.lcdui.Image.createImage(), bci=57
    - MyCanvas.init(MyCanvas.java:50)
    - MyCanvas.<init>(MyCanvas.java:25)
    - MIDletMain.<init>(MIDletMain.java:7)

    I have drag'n'dropped the pic1.png into the 501 IDE into the 'res' folder and asked the image to load from "/res/pic1.png".

    What's problem here?

    Many thanks,

    Cameron


  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,766

    Re: 3DMobile image loading give IOexception

    You can try locating the .jar file created for the project and check if the image ended up somewhere else, or missing completely. (.jar files are actually .zip files)

  3. #3
    Registered User
    Join Date
    Sep 2013
    Posts
    7

    Re: 3DMobile image loading give IOexception

    Quote Originally Posted by wizard_hu_ View Post
    You can try locating the .jar file created for the project and check if the image ended up somewhere else, or missing completely. (.jar files are actually .zip files)
    No, looks like it's in there.

    Found the problem. Depositing media in the res folder in the IDE seems to mean root. In other words it worked with "/pic1.png". Treating the "res" folder as root seems to be part of the magical mystery blackbox don't-ask-questions-it-just-works dev environment, -that I hate about Windows IDE's. But jeez louise.. onto the next obstacle..

    Thanks for you input Wizard, you're the man!

  4. #4
    Registered User
    Join Date
    Oct 2013
    Posts
    4

    Re: 3DMobile image loading give IOexception

    you are right,it's very useful !!

Similar Threads

  1. LWUIT Image-IOException
    By neeraja.nokia in forum Mobile Java General
    Replies: 8
    Last Post: 2013-04-30, 13:03
  2. IOException when loading an image
    By cjohnstone in forum Mobile Java Media (Graphics & Sounds)
    Replies: 9
    Last Post: 2008-03-05, 08:36
  3. Getting IOException while creatimg image
    By renuka_anil in forum Mobile Java General
    Replies: 2
    Last Post: 2008-02-13, 11:23
  4. Getting IOException while reading image
    By renuka_anil in forum Mobile Java General
    Replies: 3
    Last Post: 2008-01-10, 12:23
  5. Error Loading Images java.io.IOException
    By sushant_125 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-01-05, 10:53

Posting Permissions

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