Example usage for java.awt GraphicsEnvironment createGraphics

List of usage examples for java.awt GraphicsEnvironment createGraphics

Introduction

In this page you can find the example usage for java.awt GraphicsEnvironment createGraphics.

Prototype

public abstract Graphics2D createGraphics(BufferedImage img);

Source Link

Document

Returns a Graphics2D object for rendering into the specified BufferedImage .

Usage

From source file:Main.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    BufferedImage bi = new BufferedImage(10, 20, 0);
    Graphics2D g2 = ge.createGraphics(bi);

}