Hi Chris, your soft clipping: ========================================================= g.setColor(Color.BLACK); g.fillRect(0, 0, width, height); BufferedImage img = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT); Graphics2D g2 = img.createGraphics();
g2.setComposite(AlphaComposite.Src); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setColor(Color.WHITE); g2.fillOval(width/4, height/4, width/2, height/2); g2.setComposite(AlphaComposite.SrcAtop); g2.setPaint(new GradientPaint(0, 0, Color.RED, 0, height, Color.YELLOW)); g2.fillRect(0, 0, width, height); g2.dispose(); g.drawImage(img, 0, 0, null); ========================================================= I set the width = 16 and height = 16, and commnet out the line that enables antialiasing, then ouput the alpha value of the BufferedImage object: ========================================================= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ========================================================= If use antialiasing, the the alpha output is: ========================================================= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 183 231 239 191 52 0 0 0 0 0 0 0 0 0 48 243 255 255 255 255 251 56 0 0 0 0 0 0 0 0 187 255 255 255 255 255 255 195 0 0 0 0 0 0 0 0 231 255 255 255 255 255 255 239 0 0 0 0 0 0 0 0 231 255 255 255 255 255 255 239 0 0 0 0 0 0 0 0 187 255 255 255 255 255 255 195 0 0 0 0 0 0 0 0 48 243 255 255 255 255 251 56 0 0 0 0 0 0 0 0 0 48 187 235 239 195 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ========================================================= My question: What does the antiliasing algorithm do? Does the antiliasing algorithm alter the destination's alpha value? I want to understand that why when the antiliasing is on, then the alpha value of the image will be altered. [Message sent by forum member 'ylzhao' (ylzhao)] http://forums.java.net/jive/thread.jspa?messageID=158097 =========================================================================== 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".