Java Code Examples for java.awt.image.BufferedImage.getAlphaRaster()

The following are Jave code examples for showing how to use getAlphaRaster() of the java.awt.image.BufferedImage class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: incubator-netbeans   File:   Source Code and License Vote up 6 votes
 * Create a backing bitmap, painting the texture into it with the specified
 * parameters.  The bitmap will be created at 2*height, so that even if
 * there is some minor variation in height, it will not force recreating the
 * bitmap
private static BufferedImage createBitmap(int height, int type,
                                          int yDecline) {

    //Create an optimal image for blitting to the screen with no format conversion
    BufferedImage result = GraphicsEnvironment.getLocalGraphicsEnvironment()
                    200, height * 2);

    Graphics g = result.getGraphics();

    if (result.getAlphaRaster() == null) {
        Color c = type == FOCUS_TYPE ?
                MetalViewTabDisplayerUI.getActBgColor() :
        g.fillRect(0, 0, DEFAULT_IMAGE_WIDTH, height * 2);

    //draw the texture into the offscreen image
    _drawTexture(g, 0, 0, DEFAULT_IMAGE_WIDTH, height * 2, type, yDecline);
    return result;