Archived

This topic is now archived and is closed to further replies.

someone2

Color keying in J2ME

Recommended Posts

someone2    116
Hi, I hope you are very fine... just a small question... What is the way to add a color key to an image? I need for example to draw a sprite on a background I use MIDP 1.0 Thank you very much in advance...

Share this post


Link to post
Share on other sites
dot    426
You dont do it with codes/programmatically. You use a graphics editor to add either an alpha channel, or set a palette entry as a transparency index.

Share this post


Link to post
Share on other sites
MichaelT    214
That said, the problem arises when you run your app on a phone that does not support transparency or alpha.

Then you are back to using buffers and creating images again.

Share this post


Link to post
Share on other sites
dot    426
So far I havent had much problem yet even on most emulators. Note the use of *most*. I got 2 or so motorola emulators that showed the transparent area as *grasp* black! :/ And then manually creating images have a problem with midp1''s createImage buffer creating a non-transparent empty image (filled with white I think), and then Nokia''s propertiatory''s createImage for series 60 not working.

Ooh the sad stories of mobile developers.....

Share this post


Link to post
Share on other sites
MichaelT    214
The only problem I have experienced is that some phones (like SonyEricsson P800/P802 tends to lock the CPU when pressing the screen (does not have keys)) Making optimization a living hell since there seems to be nothing that could prevent it. Well, I am still looking into it at least. .. hmm. never mind. solved it. As usual it was an undocumented feature ;-)


[edited by - MichaelT on April 8, 2004 10:43:01 AM]

Share this post


Link to post
Share on other sites