You Are Here:

Community: Developer Discussion Boards

#1 Old creating an image - 2004-06-02, 17:32

Join Date: May 2004
Posts: 20
spoboyle
Offline
Registered User
hi guys

i get a IOException when trying to create an image from a png file; can anyone help?

the png is located in the root of the jar and i am using the following code:

image.createImage("/texture.png");

any ideas what is wrong?
Reply With Quote

#2 Old 2004-06-07, 05:20

Join Date: Jun 2004
Posts: 1
hrahman
Offline
Registered User
i just got that problem too few hours ago :)
i used 'try' and it works
=================
try {
image = Image.createImage(your_path);
}

catch {
}
=================
Last edited by hrahman : 2004-06-07 at 05:31.
Reply With Quote

#3 Old 2004-06-16, 21:06

Join Date: Nov 2003
Posts: 28
Location: Manchester, UK
Send a message via MSN to Phoenix_Dfire Send a message via Yahoo to Phoenix_Dfire
Phoenix_Dfire's Avatar
Phoenix_Dfire
Offline
Registered User
Unfortunately, I’ve got a similar problem and an Exception is still raised.

try {
String stemp =”/OffPU2.PNG";
Image itemp1 = Image.createImage(stemp);
}
catch (IOException e) {
System.out.println(e.toString());
}

itemp1 is still null after this code.

Can Anybody Help ?
Reply With Quote

#4 Old check the case sensiitvity. - 2004-06-17, 08:11

Join Date: May 2004
Posts: 58
Location: Mumbai
Send a message via Yahoo to gauravgandhi80
gauravgandhi80's Avatar
gauravgandhi80
Offline
Regular Contributor
u have specified the name of the img in uppercase and also the extension in uppercase. is it stored in ur directory in the same case. check this out. this might be the solution in ur case.

Gaurav.
Reply With Quote

#5 Old 2004-06-18, 16:39

Join Date: Apr 2004
Posts: 16
sinaptix
Offline
Registered User
Try putting your image into the /res directory, created in the jar root directory. Also, check if your png is in a jar at all.
Reply With Quote

#6 Old Solved. - 2004-06-18, 21:30

Join Date: Nov 2003
Posts: 28
Location: Manchester, UK
Send a message via MSN to Phoenix_Dfire Send a message via Yahoo to Phoenix_Dfire
Phoenix_Dfire's Avatar
Phoenix_Dfire
Offline
Registered User
Got it working.

My mistake, I needed to specify the path correctly.

Will remember about the res Directory though.

Thanks for everybody's help.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia