You Are Here:

Community: Developer Discussion Boards

#1 Old PNG Class - 2007-01-12, 12:42

Join Date: Nov 2006
Posts: 17
Location: Philippines
Send a message via Yahoo to pmgf_14
pmgf_14's Avatar
pmgf_14
Offline
Registered User
I stumbled into a png class which has a method that returns a PNG formatted byte array. Unfortunately the author did not elaborate on the parameters. As I have been looking for a means of saving an image as a PNG in J2ME for a very long time I am very eager to learn the posted source code. However I cannot seem to fully understand since the author did not explain what kinds of parameters the method requires. Can anyone help me on this? Here is the link to the source code:

http://www.j2meforums.com/wiki/index.php/PNG_class
Reply With Quote

#2 Old Re: PNG Class - 2007-01-12, 14:09

Join Date: Mar 2005
Posts: 84
Location: Hamburg, Germany
internetlabor's Avatar
internetlabor
Offline
Regular Contributor
Hello pmgf_14,

I also like to create a image file from a bytearray with the rgb-values. But as far I understand the code, it does not does this, but only the opposite.
The following method:
static Image create(int width, int height, ....)
uses the structure of a png file as input, and returns an J2ME-Image.
But the J2ME-Image class has no save() or getFileData() method, so this does not help us.
Maybe you can change the method, because it seems to create the right structure in the bytearray "data". So maybe you can use this bytearray and write it to a file.

I you find any other options, please post them here.

Regards

Karsten Meier
Reply With Quote

#3 Old Re: PNG Class - 2007-01-12, 14:24

Join Date: Nov 2006
Posts: 17
Location: Philippines
Send a message via Yahoo to pmgf_14
pmgf_14's Avatar
pmgf_14
Offline
Registered User
Yes i know that. you can rewrite the method and instead of returning an Image you can return the byte array in the right format.

My problem however is that i dont know how to get the palette chunk and pass it to the method static Image create(int width, int height, ....)
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue when trying to generate .sis file rmulam Symbian Tools & SDKs 9 2009-08-13 15:10
need information about j2me polish rathikathangaraj Mobile Java General 4 2007-12-19 10:01
Why should Document hold engines/models and not AppUI? nawkboy General Symbian C++ 2 2007-03-14 18:15
21 errors in j2me , help in soving them abhishek_1211 General Messaging 0 2006-04-01 10:04
Exceptions while loading application avinash_rs Mobile Java General 0 2003-06-09 11:53

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia