Problem loading images in MIDP app
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Matt_Zipay
Posted On:   Wednesday, April 16, 2003 04:40 PM

This is my file layout: $PROJECT_HOME /junk /sample /res SamplePic.png SampleMIDlet.class In my code, I use the following: Image img = Image.createImage("/SamplePic.png"); But this throws an IOException whose getMessage() method returns null, so it won't even tell me why the image won't load! Can someone please tell me what the problem is? This is excrutiatingly frustrating!!! I have tried placing the image in the same dir as the class, in /res (as above), in /res/images, and in /images (as well as trying these same variations in the createImage() call), but createImage() continues to throw IOException no matter where I put   More>>

This is my file layout:

			$PROJECT_HOME
			
/junk
/sample
/res
SamplePic.png
SampleMIDlet.class


In my code, I use the following:

Image img = Image.createImage("/SamplePic.png");


But this throws an IOException whose getMessage() method returns null, so it won't even tell me why the image won't load!


Can someone please tell me what the problem is?
This is excrutiatingly frustrating!!! I have tried placing the image in the same dir as the class, in /res (as above), in /res/images, and in /images (as well as trying these same variations in the createImage() call), but createImage() continues to throw IOException no matter where I put the image!

   <<Less

Re: Problem loading images in MIDP app

Posted By:   Liam_Quinn  
Posted On:   Friday, April 18, 2003 02:57 PM

Check what's in your JAR using "jar tvf SampleMIDlet.jar". Perhaps your build process isn't including SamplePic.png, or maybe it's putting the image somewhere else.
About | Sitemap | Contact