• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

images in palm

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have made a game in midlet and the converted it into prc for palm.When i draw images with the drawRect() method etc .the game works fine on mobile emulators and palm.But when i use a png image in the midlet it works with the cell phones but when i convert the same file using the j2me toolkit in to prc it doesnot work.what i wanted to know was whether u can load images in palm.
Thank u
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
png files are supported by the midp for palm - I've seen it working, what file is it that you converting to prc, the whole lot needed for the app or just the image?
------------------
Chanoch Wiggers
Architect for Professional Java Mobile Programming
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a simple piece of code, just put your PNG in the JAR before convert it :
Image img = null;
Form f = new Form("Hello MIDlet");
try {
img = Image.createImage("/test/empty.png");
} catch (IOException ioe) {ioe.printStackTrace();}
ImageItem ii = new ImageItem("Essai d'image ",img,ImageItem.LAYOUT_RIGHT,null);
f.append(ii);
 
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sameetbm",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks sebastein and chanoch for the replies.I tried the way which Sebastein has suggested but it didnot work.I will be a little more specific with my problem .
*Form f = new Form("Hello MIDlet");
try {
img = Image.createImage("/snake.png");
}
catch (IOException ioe) {ioe.printStackTrace();}
*ImageItem ii = new ImageItem("snake ",img,ImageItem.LAYOUT_RIGHT,null);
*f.append(ii);
message=""+a+" "+b+"hello";
g.drawImage(img, 0, 0, g.TOP|g.LEFT);
This the code i am using to draw images in the midlet.* is for the code which sebastein has suggested.When i write the java file and build a jar and jad file it works with the mobile phone emulators.But when i conver this file in to prc file with the j2me toolkit it doesnot work .My guess is that it is not able to load the image in the try block but it doenot throw any exception and the screen remains blank.can u please suggest me any remedy or send me complete sample code for loading the images .This is very urgent.
Thank u
 
sameet bm
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks sebastein and chanoch for the replies.I tried the way which Sebastein has suggested but it didnot work.I will be a little more specific with my problem .
*Form f = new Form("Hello MIDlet");
try {
img = Image.createImage("/snake.png");
}
catch (IOException ioe) {ioe.printStackTrace();}
*ImageItem ii = new ImageItem("snake ",img,ImageItem.LAYOUT_RIGHT,null);
*f.append(ii);
message=""+a+" "+b+"hello";
g.drawImage(img, 0, 0, g.TOP|g.LEFT);
This the code i am using to draw images in the midlet.* is for the code which sebastein has suggested.When i write the java file and build a jar and jad file it works with the mobile phone emulators.But when i conver this file in to prc file with the j2me toolkit it doesnot work .My guess is that it is not able to load the image in the try block but it doenot throw any exception and the screen remains blank.can u please suggest me any remedy or send me complete sample code for loading the images .This is very urgent.
Thank u
 
sameet bm
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another thing i am using canvas and not form

thank u
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic