Solved

Add transparent img on top of BufferedImage

Posted on 2004-10-03
3
198 Views
Last Modified: 2008-03-17
Hi all,
I have a .GIF image, with transparent areas on it. I also have a BufferedImage.
I would like to import and add the .GIF image on top of the BufferedImage some how.. :o\
Making sure that the transparent cells on the .GIF are also transparent after placed on top of the BufferedImage..

Can this be done?? Any examples would be MUCH appreciated! :D

Thanks in advance!
0
Comment
Question by:rubberdi
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 12211060
Get the Graphics of the buffered image and draw the gif over it

Graphics g = bi.getGraphics();
g.drawImage(yourGif......................................
0
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12249422
Hi CEHJ -- sorry about the delay.

So, your above code will draw only the 'opaque' cells ontop of the BI?

Also, how do I then turn the 'Graphics g' to an image?
Would something like this work:  Image ii = new Image( g );  // ?????

(Soz for my ignorance)

Thanks alot, :)
[r.D]
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12250845
>>So, your above code will draw only the 'opaque' cells ontop of the BI?

Should do, if you've got a gif with transparency

>>Also, how do I then turn the 'Graphics g' to an image?

What do you want to do - produce a file, or what?

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now