Color keying in J2ME

Started by
3 comments, last by someone2 20 years ago
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...
Advertisement
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.
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.
No no no no! :)
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.....
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]
No no no no! :)

This topic is closed to new replies.

Advertisement