• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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..
 
It runs on an internal combustion engine. This ad does not:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic