|
29 | 29 | import java.awt.geom.*; |
30 | 30 | import java.awt.image.*; |
31 | 31 | import java.util.Arrays; |
32 | | -import java.util.HashMap; |
33 | 32 | import java.util.Map; |
34 | 33 |
|
35 | 34 | import processing.core.*; |
@@ -295,10 +294,10 @@ public PSurface createSurface() { |
295 | 294 | * is going to return the {@link Graphics2D} object. |
296 | 295 | * @return |
297 | 296 | */ |
298 | | - @Override |
299 | | - public Image getImage() { |
300 | | - return image; |
301 | | - } |
| 297 | +// @Override |
| 298 | +// public Image getImage() { |
| 299 | +// return image; |
| 300 | +// } |
302 | 301 |
|
303 | 302 |
|
304 | 303 | /** Returns the java.awt.Graphics2D object used by this renderer. |
@@ -346,30 +345,30 @@ public Graphics2D checkImage() { |
346 | 345 | // image = new BufferedImage(width * pixelFactor, height * pixelFactor |
347 | 346 | // format == RGB ? BufferedImage.TYPE_INT_ARGB); |
348 | 347 |
|
349 | | - GraphicsConfiguration gc = null; |
350 | | - if (surface != null) { |
351 | | - Component comp = null; //surface.getComponent(); |
352 | | - if (comp == null) { |
353 | | -// System.out.println("component null, but parent.frame is " + parent.frame); |
354 | | - comp = parent.frame; |
355 | | - } |
356 | | - if (comp != null) { |
357 | | - gc = comp.getGraphicsConfiguration(); |
358 | | - } |
359 | | - } |
360 | | - // If not realized (off-screen, i.e the Color Selector Tool), gc will be null. |
361 | | - if (gc == null) { |
362 | | - //System.err.println("GraphicsConfiguration null in initImage()"); |
363 | | - GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
364 | | - gc = ge.getDefaultScreenDevice().getDefaultConfiguration(); |
365 | | - } |
| 348 | +// GraphicsConfiguration gc = null; |
| 349 | +// if (surface != null) { |
| 350 | +// Component comp = null; //surface.getComponent(); |
| 351 | +// if (comp == null) { |
| 352 | +//// System.out.println("component null, but parent.frame is " + parent.frame); |
| 353 | +// comp = parent.frame; |
| 354 | +// } |
| 355 | +// if (comp != null) { |
| 356 | +// gc = comp.getGraphicsConfiguration(); |
| 357 | +// } |
| 358 | +// } |
| 359 | +// // If not realized (off-screen, i.e the Color Selector Tool), gc will be null. |
| 360 | +// if (gc == null) { |
| 361 | +// //System.err.println("GraphicsConfiguration null in initImage()"); |
| 362 | +// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
| 363 | +// gc = ge.getDefaultScreenDevice().getDefaultConfiguration(); |
| 364 | +// } |
366 | 365 |
|
367 | 366 | // Formerly this was broken into separate versions based on offscreen or |
368 | 367 | // not, but we may as well create a compatible image; it won't hurt, right? |
369 | 368 | int wide = width * pixelDensity; |
370 | 369 | int high = height * pixelDensity; |
371 | 370 | // System.out.println("re-creating image"); |
372 | | - image = gc.createCompatibleImage(wide, high, Transparency.TRANSLUCENT); |
| 371 | + image = new BufferedImage(wide, high, BufferedImage.TYPE_INT_ARGB); |
373 | 372 | // image = gc.createCompatibleVolatileImage(wide, high); |
374 | 373 | //image = surface.getComponent().createImage(width, height); |
375 | 374 | } |
|
0 commit comments