< prev index next >

src/java.desktop/share/classes/java/awt/image/BufferedImage.java

Print this page

        

@@ -28,10 +28,11 @@
 import java.awt.Graphics2D;
 import java.awt.GraphicsEnvironment;
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.Transparency;
+import java.awt.GraphicsConfiguration;
 import java.awt.color.ColorSpace;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Hashtable;
 import java.util.Set;

@@ -71,10 +72,11 @@
     private int imageType = TYPE_CUSTOM;
     private ColorModel colorModel;
     private final WritableRaster raster;
     private OffScreenImageSource osis;
     private Hashtable<String, Object> properties;
+    private GraphicsConfiguration graphicsConfig = null;
 
     /**
      * Image Type Constants
      */
 

@@ -289,10 +291,26 @@
 
     /**
      * Constructs a {@code BufferedImage} of one of the predefined
      * image types.  The {@code ColorSpace} for the image is the
      * default sRGB space.
+     * @param config    graphics configuration
+     * @param width     width of the created image
+     * @param height    height of the created image
+     * @param imageType type of the created image
+     */
+    public BufferedImage(GraphicsConfiguration config, int width,
+                         int height,
+                         int imageType) {
+        this(width, height, imageType);
+        this.graphicsConfig = config;
+    }
+
+    /**
+     * Constructs a {@code BufferedImage} of one of the predefined
+     * image types.  The {@code ColorSpace} for the image is the
+     * default sRGB space.
      * @param width     width of the created image
      * @param height    height of the created image
      * @param imageType type of the created image
      * @see ColorSpace
      * @see #TYPE_INT_RGB

@@ -852,10 +870,19 @@
     public ColorModel getColorModel() {
         return colorModel;
     }
 
     /**
+     * Returns the {@code GraphicsConfiguration}.
+     * @return the {@code GraphicsConfiguration} of this
+     *  {@code BufferedImage}.
+     */
+    public GraphicsConfiguration getGraphicsConfig() {
+        return graphicsConfig;
+    }
+
+    /**
      * Returns the {@link WritableRaster}.
      * @return the {@code WritableRaster} of this
      *  {@code BufferedImage}.
      */
     public WritableRaster getRaster() {
< prev index next >