Skip to main content

Paint BufferedImage Opaque

2 replies [Last post]
hlander123
Offline
Joined: 2005-05-12
Points: 0

Given a BufferedImage which may contain some transparancy, is there a way that I can paint it without transparancy (that is completely opaque)? I would like to do this as efficiently as possible (would prefer not to allocate a new Image). Additionally, is there a way for me to determine whether the BufferedImage contains any transparent colors?

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous

image.getColorModel().getTransparency();

Anonymous

try:

new Color(image.getRGB(0, 0)).getAlpha()