Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

help creating transparent image

Thread view: 
Jeff - 30 Mar 2006 14:07 GMT
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
Remon van Vliet - 30 Mar 2006 16:01 GMT
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

> midp 2.0
> Java SE 5.0
[quoted text clipped - 19 lines]
>
> Jeff


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.