• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Re: Create Image in J2ME

 
Joe Cheung
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I want to create a image object using J2ME Wireless Toolkit with the following statement:
try{
Image img = Image.createImage("/Tiles.png");
}catch (IOException e) {}
and I put the image "Tiles.png" in the folder "res".
but there is "Uncaught exception java/lang/OutOfMemoryError"hen running the program.
What is the problem?
Regards,
Joe
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How big is the image file?
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Cheung:
Dear all,
I want to create a image object using J2ME Wireless Toolkit with the following statement:
try{
Image img = Image.createImage("/Tiles.png");
}catch (IOException e) {}
and I put the image "Tiles.png" in the folder "res".
but there is "Uncaught exception java/lang/OutOfMemoryError"hen running the program.
What is the problem?
Regards,
Joe

You need to reduce your image size..what is probably the case is that you have not optimized the pallete included in the png image..most graphics programs have this feature..refer to your users manaul index to find it and how to use it..
Also remember that png headers take up space if possibl eif you are using several images you might want to cut anpaste them into a multi frame filmstrip image and use clipping to load that image and choose the individual frame which represents your individual image..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic