Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4212743

Provide antialiased (i.e. soft edged) clipping

    Details

    • 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:
      2d
    • Understanding:
      Fix Understood
    • CPU:
      generic, x86
    • OS:
      generic, windows_nt

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gstone Greg Stone
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: