I've write a J2ME code that can get from a stream a picture everything work on the motorola and other phone device but the same code doe'sn't run under POSE
when i try to create the image:
Image.createImage(byteArray, 0, byteArray.length);
I receive an IllegalArgument Exception.
The same code run perfect under all other emulation.
See the documentation for the MIDP 1.0 API specification under the Image.createImage(byte[] imageData, int imageOffset, int imageLength) for the description of the requirements for the PNG image file format.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/
Re: Problem to display png image under palm os
Dec 4, 2001 7:25 AM
(reply 2
of 12) (In reply to
#1 )
Hi,
Yes I am absolutly sure about the format cause I've made myself the translation from GIF to Png.
I receive the data from StreamConnection i store the byte in a byte array then i try to create the image. Now the same image saved as his and loaded directly by contentConnection work.
The problem occurs ONLY on POSE not on other emulator
Re: Problem to display png image under palm os
Dec 6, 2001 2:23 AM
(reply 5
of 12) (In reply to
#4 )
Hi everyone who had responded to this thread,
I suddenly recalled that there is a constraint of the file size for the PNG image file when one uses the MIDP for Palm OS 1.0 BETA on a Palm device. It was a limitation imposed by the implementation.
The maximum file size for a PNG image file for use with MIDP for Palm OS 1.0 is 64kbytes i.e. any image file that is larger than 64kb will not display.
Try experimenting with smaller image file sizes and let me know if this is still true.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/
Re: Problem to display png image under palm os
Dec 6, 2001 2:32 AM
(reply 7
of 12) (In reply to
#5 )
I can display a PNG image of 5kb perfect in all devices except the palm. I download this image via a HTTP connection.
Ive seen an example called HappyFace where a PNG image is loaded from a jar file, which works perfect. But when trying to do the same via a HTTP connection this fails.
Re: Problem to display png image under palm os
Dec 7, 2001 2:21 AM
(reply 8
of 12) (In reply to
#7 )
Hi everyone.
My assumtions was too hasty. I found that when I convert my PNG image to grayscale and reduce the number of colors to 16 it works perfectly on the Palm.
Thus you can now download a 16 color grayscale PNG image via a http connection and display it in the Palm.
Definitly the number of color in the picture is the problem, the motorola emulator have no problem to display any image but the palm is limited to 16 colors.
Can I assume that the limitation with the 16 colors for the PNG image files to work with Palm OS devices is only true for the monochrome Palm displays?
I am trying to document this finding into our database here.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/