| Reply | « Previous Thread | Next Thread » |
|
hi! fullcanvas implement directgraphic support draw image and png format is work fine in it but doesnt drawimage method support this jpg or gif format??? when i used jpg instead of png it gives me error that it doesnt find jpg file why???
is in nokia series 40 sdk they allow only png format... i hope ill get this answer :) regards farhan |
|
The only image format MIDP1.0 devices are required to support is PNG, so having the ability to load, say, JPEG is optional. No S40 phone supports anything other than PNG, as far as I'm aware.
Carl. |
|
Hello
Actually you can draw JPEG images to the screen by using standard MIDP classes. Image.createImage("/someimage.jpg") Most propably old software version did not support this. |
|
hi! thanks for u guy's replies but if it does support these format then why i cant make it?
here is my code public class farhan2 extends FullCanvas implements DirectGraphics { public static String IMAGE_SOURCE = "/com/borland/jbuilder/samples/micro/uidemo/Flag2.jpg"; //some other declared funtions etc etc private void jbInit() throws Exception { addCommand(new Command("Back", Command.BACK, 1)); try{ image = Image.createImage(IMAGE_SOURCE); } catch (java.io.IOException e) { System.out.println(e.getMessage()); System.out.println("image not found"); } } protected void paint(Graphics g) { DirectGraphics dg = DirectUtils.getDirectGraphics(g); g.setColor(232,33,44); g.drawLine(44,33,22,11); dg.drawTriangle(33,22,11,66,54,33,422); dg.fillTriangle(87,98,12,44,76,77,44); //dg.drawImage(image,55,88,1,0); g.drawImage(image,33,44,1); } } i tried both from driectgraphic as well as from simple graphic mode but still doesnt work but png always works fine :( |
|
If the problem was that the format is not supported it would probably give an error that says that, but you say:
Quote:
Most of the time problems like these are just a matter of finding the file... But then of course, maybe there really is no support for JPEGs. I know I have never tried displaying one. Why don't you just use a PNG. shmoove |
|
no its no the problem of path just u also try to load jpg i guess they doesnt support jpg format ....cuz all path and every thing are set even i tried to load gif but couldnt saw anything at all so i guess only png format is supported for series 40 application work, maybe!!!!
|
|
Check that image exists in the final JAR file and at the same path as *.png images you use
Some IDEs including JBuilder and Sun's Wireless toolkit automatically copy only severel file types into the JAR. Of course, *.jpg is not among them. |
|
but still i dont get it what do u mean if its in jar or not because in jar file its showing only this
Manifest-Version: 1.0 MIDlet-Name: UIDemoMIDlet MIDlet-1: UIDemoMidlet, /icons/ivanIcon.png, com.borland.jbuilder.samp les.micro.uidemo.UIDemoMidlet MIDlet-Icon: /icons/ivanIcon.png MIDlet-Version: 1.0 MIDlet-Vendor: Borland Software Corporation MicroEdition-Configuration: CLDC-1.0 MicroEdition-Profile: MIDP-1.0 so where i can define that it should read jpg i know i can make work withj png but if its avail as jpg then why i cant use it ? everything is on the same path where png file is exist .... |
|
What you are describing is not a jar file, it's the jad file.
When you build an MIDP application you end up eith two files: the jad and the jar. The jad is the file you described in the previous post, and it contains general information about the application. The jar is the archive that contains the application itself (class files, resources, etc.). A jar file is actually no more than a zip file with a different extension, so you can open it with WinZip, or WinRAR, or the zip utility of your choice, and check if the jpg file is in there somewhere and what is the path to it. shmoove |
|
hey thanks shmoove to reply me,
i checked the jar file by unzipping it and found the jpg picture same as how i am defining the path means no mistake i am doing at all, then now i am sure that it doesnt support gif and jpg ... but does all games build in nokia40 series with png picture format? cuz i really wana build the game ... thanks alot again farhan |
|
Then just use PNGs then. That's what we all do. :)
|
|
Not all of us :)
I use graphics preconverted to screen format to paint it ffffast! :) And png for splash screen only |
|
Now you're just showing off ;P
|
|
Somewhat related to this, can Java on the 3650 read the JPG files created by the camera app?
I want to send .jpg files created by camera app (and therefore VGA quality versus what MMAPI offers) to a URL of mine.. Thanks Chris |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|