• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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..
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic