Example usage for java.awt.image BufferedImage releaseWritableTile

List of usage examples for java.awt.image BufferedImage releaseWritableTile

Introduction

In this page you can find the example usage for java.awt.image BufferedImage releaseWritableTile.

Prototype

public void releaseWritableTile(int tileX, int tileY) 

Source Link

Document

Relinquishes permission to write to a tile.

Usage

From source file:lucee.runtime.img.Image.java

private static BufferedImage addAlpha(BufferedImage src, BufferedImage alpha, int x, int y) {
    int w = src.getWidth();
    int h = src.getHeight();
    BufferedImage bi = new BufferedImage(w, h, 2);
    WritableRaster wr = bi.getWritableTile(0, 0);
    WritableRaster wr3 = wr.createWritableChild(0, 0, w, h, 0, 0, new int[] { 0, 1, 2 });
    WritableRaster wr1 = wr.createWritableChild(0, 0, w, h, 0, 0, new int[] { 3 });
    wr3.setRect(src.getData());//from  w  ww .  j  a v a2s . c o m
    wr1.setRect(alpha.getData());
    bi.releaseWritableTile(0, 0);
    return bi;
}

From source file:pl.edu.icm.visnow.lib.utils.ImageUtilities.java

public static BufferedImage addAlpha(BufferedImage src, BufferedImage alpha) {
    int w = src.getWidth();
    int h = src.getHeight();

    BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

    WritableRaster wr = bi.getWritableTile(0, 0);
    WritableRaster wr3 = wr.createWritableChild(0, 0, w, h, 0, 0, new int[] { 0, 1, 2 });
    WritableRaster wr1 = wr.createWritableChild(0, 0, w, h, 0, 0, new int[] { 3 });
    wr3.setRect(src.getData());//from   w ww  .ja  v a2 s  .  co  m
    wr1.setRect(alpha.getData());

    bi.releaseWritableTile(0, 0);

    return bi;
}