AnsweredAssumed Answered

Transparent Avatar Image

Question asked by srhode on Mar 4, 2009
Latest reply on Sep 13, 2010 by wroot

I was investigating why an avatar image that has a transparent background changes to a black background when you save your VCard.


Here is what I found.


The GraphicUtils class has a method called convert, this method converts the java.awt.Image to a java.awt.image.BufferedImage.


Existing Code:


BufferedImage bi = new BufferedImage(im.getWidth(null), im.getHeight(null), BufferedImage.TYPE_INT_RGB);


The BufferedImage.TYPE_INT_RGB does not support transparency, I changed it to BufferedImage.TYPE_INT_ARGB_PRE wich does support transparency and it works fine.


My question is, is there a reason that the BufferedImage's imageType needs to be set to BufferedImage.TYPE_INT_RGB?