protected Graphics2D createGraphics(BufferedImage bi) { return GraphicsUtil.createGraphics(bi); }
Graphics2D g2d = GraphicsUtil.createGraphics(dest); try { if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {
/** * Construct a fully transparent image <code>bounds</code> size, will * paint one tile with paint. Thus paint should not be a pattered * paint or gradient but should be a solid color. * @param bounds the bounds of the image (in fact will respond with * any request). */ public FloodRed(Rectangle bounds, Paint paint) { super(); // We _must_ call init... ColorModel cm = GraphicsUtil.sRGB_Unpre; int defSz = AbstractTiledRed.getDefaultTileSize(); int tw = bounds.width; if (tw > defSz) tw = defSz; int th = bounds.height; if (th > defSz) th = defSz; // fix my sample model so it makes sense given my size. SampleModel sm = cm.createCompatibleSampleModel(tw, th); // Finish initializing our base class... init((CachableRed)null, bounds, cm, sm, 0, 0, null); raster = Raster.createWritableRaster(sm, new Point(0, 0)); BufferedImage offScreen = new BufferedImage(cm, raster, cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen); g.setPaint(paint); g.fillRect(0, 0, bounds.width, bounds.height); g.dispose(); }
/** * Construct a fully transparent image <code>bounds</code> size, will * paint one tile with paint. Thus paint should not be a pattered * paint or gradient but should be a solid color. * @param bounds the bounds of the image (in fact will respond with * any request). */ public FloodRed(Rectangle bounds, Paint paint) { super(); // We _must_ call init... ColorModel cm = GraphicsUtil.sRGB_Unpre; int defSz = AbstractTiledRed.getDefaultTileSize(); int tw = bounds.width; if (tw > defSz) tw = defSz; int th = bounds.height; if (th > defSz) th = defSz; // fix my sample model so it makes sense given my size. SampleModel sm = cm.createCompatibleSampleModel(tw, th); // Finish initializing our base class... init((CachableRed)null, bounds, cm, sm, 0, 0, null); raster = Raster.createWritableRaster(sm, new Point(0, 0)); BufferedImage offScreen = new BufferedImage(cm, raster, cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen); g.setPaint(paint); g.fillRect(0, 0, bounds.width, bounds.height); g.dispose(); }
/** * Construct a fully transparent image <code>bounds</code> size, will * paint one tile with paint. Thus paint should not be a pattered * paint or gradient but should be a solid color. * @param bounds the bounds of the image (in fact will respond with * any request). */ public FloodRed(Rectangle bounds, Paint paint) { super(); // We _must_ call init... ColorModel cm = GraphicsUtil.sRGB_Unpre; int defSz = AbstractTiledRed.getDefaultTileSize(); int tw = bounds.width; if (tw > defSz) tw = defSz; int th = bounds.height; if (th > defSz) th = defSz; // fix my sample model so it makes sense given my size. SampleModel sm = cm.createCompatibleSampleModel(tw, th); // Finish initializing our base class... init((CachableRed)null, bounds, cm, sm, 0, 0, null); raster = Raster.createWritableRaster(sm, new Point(0, 0)); BufferedImage offScreen = new BufferedImage(cm, raster, cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen); g.setPaint(paint); g.fillRect(0, 0, bounds.width, bounds.height); g.dispose(); }
public void genRect(WritableRaster wr) { // System.out.println(" Rect: " + wr.getBounds()); BufferedImage offScreen = new BufferedImage(cm, wr.createWritableTranslatedChild(0,0), cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen, hints); g.setComposite(AlphaComposite.Clear); g.fillRect(0, 0, wr.getWidth(), wr.getHeight()); g.setComposite(AlphaComposite.SrcOver); g.translate(-wr.getMinX(), -wr.getMinY()); // Set transform g.transform(node2dev); // Invoke primitive paint. if (usePrimitivePaint) { node.primitivePaint(g); } else { node.paint (g); } g.dispose(); }
public void genRect(WritableRaster wr) { // System.out.println(" Rect: " + wr.getBounds()); BufferedImage offScreen = new BufferedImage(cm, wr.createWritableTranslatedChild(0,0), cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen, hints); g.setComposite(AlphaComposite.Clear); g.fillRect(0, 0, wr.getWidth(), wr.getHeight()); g.setComposite(AlphaComposite.SrcOver); g.translate(-wr.getMinX(), -wr.getMinY()); // Set transform g.transform(node2dev); // Invoke primitive paint. if (usePrimitivePaint) { node.primitivePaint(g); } else { node.paint (g); } g.dispose(); }
public void genRect(WritableRaster wr) { // System.out.println(" Rect: " + wr.getBounds()); BufferedImage offScreen = new BufferedImage(cm, wr.createWritableTranslatedChild(0,0), cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(offScreen, hints); g.setComposite(AlphaComposite.Clear); g.fillRect(0, 0, wr.getWidth(), wr.getHeight()); g.setComposite(AlphaComposite.SrcOver); g.translate(-wr.getMinX(), -wr.getMinY()); // Set transform g.transform(node2dev); // Invoke primitive paint. if (usePrimitivePaint) { node.primitivePaint(g); } else { node.paint (g); } g.dispose(); }
Graphics2D g2d = GraphicsUtil.createGraphics (workImg, renderingHints);
cm.isAlphaPremultiplied(), null); Graphics2D g2d = GraphicsUtil.createGraphics(bi); g2d.translate(-r.x, -r.y);
cm.isAlphaPremultiplied(), null); Graphics2D g2d = GraphicsUtil.createGraphics(bi); g2d.translate(-r.x, -r.y);
cm.isAlphaPremultiplied(), null); Graphics2D g2d = GraphicsUtil.createGraphics(bi); g2d.translate(-r.x, -r.y);
cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(bi, hints);
devAOIR = usr2dev.createTransformedShape(aoi).getBounds(); Graphics2D g2d = GraphicsUtil.createGraphics(bi, rh);
cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(bi, hints);
cm.isAlphaPremultiplied(), null); Graphics2D g = GraphicsUtil.createGraphics(bi, hints);
devAOIR = usr2dev.createTransformedShape(aoi).getBounds(); Graphics2D g2d = GraphicsUtil.createGraphics(bi, rh);
devAOIR = usr2dev.createTransformedShape(aoi).getBounds(); Graphics2D g2d = GraphicsUtil.createGraphics(bi, rh);
Graphics2D g2d = GraphicsUtil.createGraphics(dest); if (hints.containsKey(KEY_BACKGROUND_COLOR)) { Paint bgcolor = (Paint)hints.get(KEY_BACKGROUND_COLOR);
Graphics2D g2d = GraphicsUtil.createGraphics(dest); if (hints.containsKey(KEY_BACKGROUND_COLOR)) { Paint bgcolor = (Paint)hints.get(KEY_BACKGROUND_COLOR);