Re: Making color image with transparency into black & white w/transparency
- From: gswarthout@xxxxxxxxx
- Date: 29 Mar 2007 12:33:57 -0700
Solution found, with help from Knute:
BufferedImage bufferedImage = new BufferedImage(usableWidth,
usableHeight, BufferedImage.TYPE_4BYTE_ABGR_PRE);
bufferedImage.createGraphics().drawImage(img, 0, 0, usableWidth,
usableHeight, this);
ColorSpace grayColorSpace =
ColorSpace.getInstance(ColorSpace.CS_GRAY);
ColorConvertOp op = new ColorConvertOp(grayColorSpace,
bufferedImage.getColorModel().getColorSpace(), null);
op.filter(bufferedImage, bufferedImage);
g.drawImage(bufferedImage, MARGIN, MARGIN, usableWidth, usableHeight,
this);
Greg
.
- References:
- Prev by Date: Re: Making color image with transparency into black & white w/transparency
- Next by Date: Re: SWT without Eclipse?
- Previous by thread: Re: Making color image with transparency into black & white w/transparency
- Next by thread: J2SE 1.4 Solaris window always on top
- Index(es):