Example usage for java.awt.image VolatileImage flush

List of usage examples for java.awt.image VolatileImage flush

Introduction

In this page you can find the example usage for java.awt.image VolatileImage flush.

Prototype

public void flush() 

Source Link

Document

Flushes all reconstructable resources being used by this Image object.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int i = 0; i < gs.length; i++) {
        VolatileImage im = gs[i].getDefaultConfiguration().createCompatibleVolatileImage(1, 1);
        int bytes = gs[i].getAvailableAcceleratedMemory();
        if (bytes < 0) {
            System.out.println("Amount of memory is unlimited");
        }/*from w  w w  .ja  v a  2s. c om*/

        im.flush();
    }
}