/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the width of the image to create * @param pHeight the height of the image to create * @param pType the type of image to create (one of the constants from * {@link BufferedImage} or {@link #BI_TYPE_ANY}) * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, int pType, Color pBackground) { return createClear(pWidth, pHeight, pType, Transparency.OPAQUE, pBackground, DEFAULT_CONFIGURATION); }
/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the requested width of the image * @param pHeight the requested height of the image * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, Color pBackground) { return createClear(pWidth, pHeight, BI_TYPE_ANY, pBackground); }
private void createBuffered() { if (width > 0 && height > 0) { if (sourceColorModel != null && sourcePixels != null) { // TODO: Fix pixel size / color model problem WritableRaster raster = ImageUtil.createRaster(width, height, sourcePixels, sourceColorModel); buffered = new BufferedImage(sourceColorModel, raster, sourceColorModel.isAlphaPremultiplied(), sourceProperties); } else { buffered = ImageUtil.createClear(width, height, null); } } // Clean up, in case any objects are copied/cloned, so we can free resources freeResources(); }
BufferedImage temp = createClear(w, h, BI_TYPE_ANY, getTransparency(pImage), pBackgroundColor, pConfiguration); drawOnto(temp, pImage);
/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the requested width of the image * @param pHeight the requested height of the image * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, Color pBackground) { return createClear(pWidth, pHeight, BI_TYPE_ANY, pBackground); }
/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the requested width of the image * @param pHeight the requested height of the image * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, Color pBackground) { return createClear(pWidth, pHeight, BI_TYPE_ANY, pBackground); }
/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the width of the image to create * @param pHeight the height of the image to create * @param pType the type of image to create (one of the constants from * {@link BufferedImage} or {@link #BI_TYPE_ANY}) * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, int pType, Color pBackground) { return createClear(pWidth, pHeight, pType, Transparency.OPAQUE, pBackground, DEFAULT_CONFIGURATION); }
/** * Creates a clear image with the given background color. * * @see BufferedImage#BufferedImage(int,int,int) * * @param pWidth the width of the image to create * @param pHeight the height of the image to create * @param pType the type of image to create (one of the constants from * {@link BufferedImage} or {@link #BI_TYPE_ANY}) * @param pBackground the background color. The color may be translucent. * May be {@code null}, in such case the color is undefined. * * @throws IllegalArgumentException if {@code pType} is not a valid type * for {@code BufferedImage} * * @return the new image */ public static BufferedImage createClear(int pWidth, int pHeight, int pType, Color pBackground) { return createClear(pWidth, pHeight, pType, Transparency.OPAQUE, pBackground, DEFAULT_CONFIGURATION); }
private void createBuffered() { if (width > 0 && height > 0) { if (sourceColorModel != null && sourcePixels != null) { // TODO: Fix pixel size / color model problem WritableRaster raster = ImageUtil.createRaster(width, height, sourcePixels, sourceColorModel); buffered = new BufferedImage(sourceColorModel, raster, sourceColorModel.isAlphaPremultiplied(), sourceProperties); } else { buffered = ImageUtil.createClear(width, height, null); } } // Clean up, in case any objects are copied/cloned, so we can free resources freeResources(); }
private void createBuffered() { if (mWidth > 0 && mHeight > 0) { if (mSourceColorModel != null && mSourcePixels != null) { // TODO: Fix pixel size / color model problem WritableRaster raster = ImageUtil.createRaster(mWidth, mHeight, mSourcePixels, mSourceColorModel); mBuffered = new BufferedImage(mSourceColorModel, raster, mSourceColorModel.isAlphaPremultiplied(), mSourceProperties); } else { mBuffered = ImageUtil.createClear(mWidth, mHeight, null); } } // Clean up, in case any objects are copied/cloned, so we can free resources freeResources(); }
BufferedImage temp = createClear(w, h, BI_TYPE_ANY, getTransparency(pImage), pBackgroundColor, pConfiguration); drawOnto(temp, pImage);
BufferedImage temp = createClear(w, h, BI_TYPE_ANY, getTransparency(pImage), pBackgroundColor, pConfiguration); drawOnto(temp, pImage);