participate


CLDC and MIDP - Problem to display png image under palm os
<<   Back to Forum  |   Give us Feedback
This topic has 12 replies on 1 page.
richiegr
Posts:16
Registered: 1/12/99
Problem to display png image under palm os   
Dec 3, 2001 8:26 AM

 
Hi,

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.

Something can help me
thanks

Richard
Richard@goldmail.net.il
 
allenlai
Posts:377
Registered: 7/1/98
Re: Problem to display png image under palm os   
Dec 4, 2001 2:24 AM (reply 1 of 12)  (In reply to original post )

 
[richiegr],

Is the image file in the PNG format?

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/
 
richiegr
Posts:16
Registered: 1/12/99
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

Thanks

Richard
 
mopfattn
Posts:26
Registered: 8/15/97
Re: Problem to display png image under palm os   
Dec 5, 2001 3:37 AM (reply 3 of 12)  (In reply to #2 )

 
Hi,

I have the same problem on my Palm. I can display images on the Siemens SL45i, but not on Palm devices.

Marco
 
johnlw
Posts:10
Registered: 10/29/01
Re: Problem to display png image under palm os   
Dec 6, 2001 2:07 AM (reply 4 of 12)  (In reply to #3 )

 
If anyone has solved this PNG problem under the palm, please inform me.
 
allenlai
Posts:377
Registered: 7/1/98
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/
 
johnlw
Posts:10
Registered: 10/29/01
Re: Problem to display png image under palm os   
Dec 6, 2001 2:30 AM (reply 6 of 12)  (In reply to #5 )

 
I can display a PNG image of 5kb perfect in all devices except the palm.

Thus ur assumption is incorrect.
 
johnlw
Posts:10
Registered: 10/29/01
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.

Thus ur assumption is incorrect.
 
johnlw
Posts:10
Registered: 10/29/01
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.

Cheers folks
John
 
richiegr
Posts:16
Registered: 1/12/99
Re: Problem to display png image under palm os   
Dec 11, 2001 7:18 AM (reply 9 of 12)  (In reply to #8 )

 
Hi,

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.

Thanks

Richard
 
allenlai
Posts:377
Registered: 7/1/98
Re: Problem to display png image under palm os   
Dec 11, 2001 6:31 PM (reply 10 of 12)  (In reply to #9 )

 
To all who responded to this thread,

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/
 
mopfattn
Posts:26
Registered: 8/15/97
Re: Problem to display png image under palm os   
Dec 12, 2001 3:15 AM (reply 11 of 12)  (In reply to #10 )

 
This limitation seems to exist also for Palms with color displays, like the Palm m505.
 
lnoelstorr
Posts:348
Registered: 1/28/00
Re: Problem to display png image under palm os   
Dec 12, 2001 3:29 AM (reply 12 of 12)  (In reply to #11 )

 
Is there any difference between the size of an image and the size of the object representing that image?

From the way I understand the KVM on the Palm works, no Object can be bigger than 64K.

Is it possible that an Object representing a 5K image could be more than 64K?
 
This topic has 12 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 28
  • Guests : 133

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums