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

BufferedImage.getScaledInstance(int,int,int) throws NullP.Exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • 2d
    • x86
    • windows_nt



      Name: rm29839 Date: 04/21/98


      BufferedImage.getScaledInstance(int,int,int) throws NPException:

      BufferedImage image = new BufferedImage(10,10,BufferedImage.TYPE_INT_RGB);

      Image testImage =
      image.getScaledInstance(5,5,BufferedImage.SCALE_DEFAULT);

      result = (
      testImage.getWidth(null) == 5 &&
      testImage.getHeight(null) == 5
      );

      Wrapped up into real code:
      import java.awt.*;
      import java.awt.image.*;

      public class BuffTest {
        
        public static void main (String[] args){
          BufferedImage image = new BufferedImage(10,10,BufferedImage.TYPE_INT_RGB);

      Image testImage =
      image.getScaledInstance(5,5,BufferedImage.SCALE_DEFAULT);

      boolean result = ( testImage.getWidth(null) == 5 &&
      testImage.getHeight(null) == 5);
        }
      }
      (Review ID: 27725)
      ======================================================================

            jehung Jeannette Hung (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: