• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a BufferedImage of transparent image

 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

How to create bufferedImage of an image that has transparent pixels?
If do so:
tail=new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
Graphics tailContext = tail.createGraphics();
tailContext.drawImage(tailImage, 0, 0, null);

the whole image will be transparent.
and if so:
new BufferedImage(10, 10, BufferedImage.TYPE_INT_AGB);
the transparent parts will be black.
[ August 21, 2004: Message edited by: Juhan Voolaid ]
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried setting alpha interpolation?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!