Forums Register Login

Creating a BufferedImage of transparent image

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
have you tried setting alpha interpolation?
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1850 times.
Similar Threads
Using the IndexColorModel class to create a BufferedImage
Having problem for converting .png image to transparent image
Having problem for converting .png image to transparent image
Show semi-transparent image on top of other JPEG
Setting java.awt.Image background color
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:37:18.