Images work in toolkit but not on phone
Here's the code I'm using
try
{
image = Image.createImage("/duke2.png");
}
catch (Exception error)
{
Alert alert =new Alert("Failure",
"Can't open image file.", null,null);
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert);
}
}
protectedvoid paint(Graphics graphics)
{
if (image !=null)
{
graphics.drawImage(image, 50, 50,
Graphics.VCENTER | Graphics.HCENTER);
}
}
I found it online, though I've tried several others I found and none of them work either. It works fine when I run it in the toolkit, but when I try it on my phone which is an audiovoxx smt5600, it comes up with exception and displays can't open image. It also only displays the alert for a split second before going to a blank screen, when I think it should leave it up. Thanks for any help.
[1482 byte] By [
tyler9768a] at [2007-11-26 12:48:05]

# 5
i am also getting same problem
Image.createImage works fine in nokia but in samsung d500 it is unable to find the image.i have tried all formats ie jpeg,gig,png but noone worked
I am creating image like this
Image abc=Image.createImage("/images/abc.png")
any suggestion plz help
# 9
sorry, I'm pretty new at this too. My only suggestion is to check through the forum there are thousands of posts here someone else might have your problem. If you haven't tried searching, use that feature with your phone's name.
When I was re-reading the thread to see your original message I also reread armor's (or something I can't see the screenname on this screen) reply and realize he gave me the answer. When I read his originally I checked the file name, but not the extension which doesn't show on my computer. At any rate I gave him the duke dollars thanks!