-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
None
-
generic
-
generic
The following test case shows that the GraphicsConfiguration of a BufferedImage
will report the bounds of the first BufferedImage of that type that was
created.
------- BIGCTest.java -------
import java.awt.*;
import java.awt.image.*;
public class BIGCTest {
public static void main(String argv[]) {
int type = BufferedImage.TYPE_INT_RGB;
BufferedImage img1 = new BufferedImage(10, 10, type);
BufferedImage img2 = new BufferedImage(20, 20, type);
GraphicsConfiguration gc1 =
img1.createGraphics().getDeviceConfiguration();
GraphicsConfiguration gc2 =
img2.createGraphics().getDeviceConfiguration();
System.out.println("config1 bounds = "+gc1.getBounds());
System.out.println("config2 bounds = "+gc2.getBounds());
}
}
-----------------------------
will report the bounds of the first BufferedImage of that type that was
created.
------- BIGCTest.java -------
import java.awt.*;
import java.awt.image.*;
public class BIGCTest {
public static void main(String argv[]) {
int type = BufferedImage.TYPE_INT_RGB;
BufferedImage img1 = new BufferedImage(10, 10, type);
BufferedImage img2 = new BufferedImage(20, 20, type);
GraphicsConfiguration gc1 =
img1.createGraphics().getDeviceConfiguration();
GraphicsConfiguration gc2 =
img2.createGraphics().getDeviceConfiguration();
System.out.println("config1 bounds = "+gc1.getBounds());
System.out.println("config2 bounds = "+gc2.getBounds());
}
}
-----------------------------
- duplicates
-
JDK-8072682 getBounds call on graphics.getDeviceConfiguration() returning cached information
-
- Resolved
-