Hi Nuno,
On Mon, Apr 08, 2002 at 11:45:0p +0100, Nuno Emanuel Figueiredo de Carvalho wrote:
> > you can do this, for example, this way:
> > BufferedImage bi = ..; // your image
> > BufferedImage grayBi = new BufferedImage(bi.getWidth(), getHeight(),
> > BufferedImage.TYPE_BYTE_GRAY);
> > Graphics g = grayBi.getGraphics();
> > g.drawImage(bi, 0, 0, null);
> >
> > Now you have a grayscale version of the bi image in the grayBi.
>
> Thanks for your help.
> It works fine but it has a little "problem". If my image is a
> transparent GIF it will have a black background as result.
> Is there any way to set transparency color ? I only found get methods
> for transparencies....
Use method
g.drawImage(bi, 0, 0, <color>, null);
where <color> is your desired color.
Check out the Graphics and Graphics2D API docs for more info.
Thank you,
Dmitri
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".