protected void rescaleImage(int width, int height, int hint) { Image master = getMasterImage(); if (master!=null) { bgImage = createAcceleratedImage(width, height); Graphics2D g = bgImage.createGraphics(); g.addRenderingHints(hints);
private BufferedImage createAcceleratedImage(int width, int height) { GraphicsConfiguration gc= getRTextAreaBase().getGraphicsConfiguration(); BufferedImage image = gc.createCompatibleImage(width, height); return image; }
if (oldBG instanceof Image) { // Just change image being displayed. ((BufferedImageBackgroundPainterStrategy)backgroundPainter). setImage(image); new BufferedImageBackgroundPainterStrategy(this); strategy.setImage(image); backgroundPainter = strategy;
new BufferedImageBackgroundPainterStrategy(this); strategy.setImage(image); backgroundPainter = strategy;
/** * Rescales the displayed image to be the specified size. * * @param width The new width of the image. * @param height The new height of the image. * @param hint The scaling hint to use. */ protected void rescaleImage(int width, int height, int hint) { Image master = getMasterImage(); if (master!=null) { bgImage = master.getScaledInstance(width,height, hint); tracker.addImage(bgImage, 1); try { tracker.waitForID(1); } catch (InterruptedException e) { e.printStackTrace(); bgImage = null; return; } finally { tracker.removeImage(bgImage, 1); } } else { bgImage = null; } }
if (oldBG instanceof Image) { // Just change image being displayed. ((BufferedImageBackgroundPainterStrategy)backgroundPainter). setImage(image); new BufferedImageBackgroundPainterStrategy(this); strategy.setImage(image); backgroundPainter = strategy;
new BufferedImageBackgroundPainterStrategy(this); strategy.setImage(image); backgroundPainter = strategy;
/** * Rescales the displayed image to be the specified size. * * @param width The new width of the image. * @param height The new height of the image. * @param hint The scaling hint to use. */ protected void rescaleImage(int width, int height, int hint) { Image master = getMasterImage(); if (master!=null) { bgImage = master.getScaledInstance(width,height, hint); tracker.addImage(bgImage, 1); try { tracker.waitForID(1); } catch (InterruptedException e) { e.printStackTrace(); bgImage = null; return; } finally { tracker.removeImage(bgImage, 1); } } else { bgImage = null; } }
protected void rescaleImage(int width, int height, int hint) { Image master = getMasterImage(); if (master!=null) { bgImage = createAcceleratedImage(width, height); Graphics2D g = bgImage.createGraphics(); g.addRenderingHints(hints);
private BufferedImage createAcceleratedImage(int width, int height) { GraphicsConfiguration gc= getRTextAreaBase().getGraphicsConfiguration(); BufferedImage image = gc.createCompatibleImage(width, height); return image; }