Java BufferedImage Operation applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight)

Here you can find the source of applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight)

Description

apply Alpha Mask

License

Apache License

Declaration

private static void applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.*;

import java.awt.image.BufferedImage;

public class Main {
    private static void applyAlphaMask(BufferedImage buffer, BufferedImage alphaMask, int imgHeight) {

        Graphics2D g2 = buffer.createGraphics();
        g2.setComposite(AlphaComposite.DstOut);
        g2.drawImage(alphaMask, null, 0, imgHeight);
        g2.dispose();/*from   ww  w  . ja  v a  2 s. c om*/
    }
}

Related

  1. appendImages(BufferedImage leftImage, BufferedImage rightImage)
  2. applyExplicitSMask(BufferedImage baseImage, BufferedImage sMaskImage)
  3. applyGrayDecode(BufferedImage rgbImage, int bitsPerComponent, float[] decode)
  4. applyGrayscaleMaskToAlpha(BufferedImage image, BufferedImage mask)
  5. applyMask(BufferedImage img, Color keyColor)