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

Error thrown from getGraphics method of a BytePacked BufferedImage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic

      The following test case will allow the BufferedImage to be constructed
      but will throw an InternalError from the 2D implementation when a
      Graphics object is fetched from the image.

      import java.awt.image.IndexColorModel;
      import java.awt.image.BufferedImage;
      import java.awt.image.DataBuffer;
      import java.awt.image.WritableRaster;
      import java.awt.image.Raster;

      public class BytePackedICMTest {
          static byte vals[] = { 0, -1 };

          public static void main(String args[]) {
      IndexColorModel icm = new IndexColorModel(8, 2, vals, vals, vals);
      WritableRaster raster =
      Raster.createPackedRaster(DataBuffer.TYPE_BYTE,
      1, 1, 1, 1, null);
      BufferedImage bi = new BufferedImage(icm, raster, false, null);
      bi.getGraphics().dispose();
          }
      }

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: