Categories: Java | Code Examples | How To | Java ME | Graphics
This page was last modified 08:39, 25 September 2007.
How to read an image file from the JAR
From Forum Nokia Wiki
To read an image file from the JAR to an Image object, you should use this code:
try { Image logo = Image.createImage("/path_to_the_image"); } catch (java.io.IOException e) { System.err.println("Image read error"); }
Remember:
- You must use the first slash "/" to refer to the root of the JAR file.
- You must include the image in the project to be included in the JAR file by the IDE you are using.
- To be 100% standard to all devices, the image should be in PNG format. Many Nokia devices supports GIF, JPG and BMP to.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read images from phone gallery | piyush.kh | Mobile Java General | 12 | 2008-01-03 18:33 |
| Invalid JAR file | regis.melo | Mobile Java General | 3 | 2007-12-27 09:08 |
| How to store Images in RMS? | lightpop | Mobile Java General | 5 | 2005-02-07 18:11 |
| 6230 JAR max filesize | Wontar | Mobile Java General | 3 | 2007-01-30 12:31 |
| S60 PAK file read Problem | chamidu_ksol | Mobile Java General | 1 | 2007-02-10 02:27 |
