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

Transparent pixels in drawn images become visible, if the graphics includes rotation

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      any / any

      A DESCRIPTION OF THE PROBLEM :
      If an image with transparent pixels around the edges is drawn rotated, black pixels appear
      where the border of the image would be.

      I believe this is a fundamental hole in the drawing model. Graphics2D provides for a pixel value
      for transparent pixels being drawn, but does not provide for a pixel value of nonexistant pixels being sampled.
      When a raster image is being sampled under these circumstances, it's essential that "outside the edge" pixels
      are used in some way.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      graphics.setRotation(Math.pi/3);
      graphics.drawImage(image,tx,ty,w,h);

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Smooth invisible edges
      ACTUAL -
      dirty pixels appear where the invisible edge of the image should be

      ---------- BEGIN SOURCE ----------
      I can supply sample output

      ---------- END SOURCE ----------

            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: