help creating transparent image

J

Jeff

midp 2.0
Java SE 5.0
J2ME version 2.2

This code creates an image with white background with circle filled with a
light green color:
Image image = Image.createImage(60,60);
Graphics s = image.getGraphics();
s.setColor(0xCCFFCC);
s.fillArc(0, 0, 60, 60, 90, 360);

But I don't want the white background, I want the background to be
transparent... This image is put into a sprite and displayed on the screen.
And I very much would like to remove the white background of the image
object - it would greatly improve the layout...

This image is created during program execution... so I cannot fix this using
Photoshop or any other image edititing software

So please come with suggestions on how to make the white background
transparent

Jeff
 
R

Remon van Vliet

You can create images with alpha support using BufferedImage and such. I'm
not aware of MIDP supporting (partially) transparent images created in code
without a bit of a workaround. Said workaround involves creating a PNG
compatible byte[] from your original pixel data and pass it to
createImage(byte[] imageData);

Remon van Vliet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top