Solved

Add transparent img on top of BufferedImage

Posted on 2004-10-03
3
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

615 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