• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Re: Create Image in J2ME

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How big is the image file?
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
reply
    Bookmark Topic Watch Topic
  • New Topic