-
Type:
Enhancement
-
Status: Open
-
Priority:
P5
-
Resolution: Unresolved
-
Affects Version/s: 1.2.0, 1.4.0
-
Fix Version/s: None
-
Component/s: client-libs
-
Labels:
-
Subcomponent:
-
Understanding:Fix Understood
-
CPU:generic, x86
-
OS:generic, windows_nt
Name: gsC80088 Date: 02/18/99
When an image or filled shape is clipped, it isn't antialiased along the clipping path. Here's a sample program illustrating the problem -- it draws a filled rectangle, clipped by an ellipse.
import java.awt.*;
import java.awt.geom.*;
public class Clipper extends Canvas {
public static void main(String args[]) {
Canvas canvas = new Clipper();
Frame frame = new Frame();
frame.setSize(640, 480);
frame.add("Center", canvas);
frame.show();
}
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(Color.red);
g2d.clip(new Ellipse2D.Float(100, 100, 300, 200));
g2d.fillRect(100, 100, 300, 200);
}
}
(Review ID: 54362)
======================================================================
- duplicates
-
JDK-4533219 anti-aliasing disabled by non-rectangular clipping
-
- Closed
-